开发者

Migrating from Flex 4/4.5 to 4.5.1 for mobiles

开发者 https://www.devze.com 2023-04-02 00:36 出处:网络
I am trying to migrate from flex code written in flex 4/4.5 using mx to be compatible with flex 4.5.1 using only spark.

I am trying to migrate from flex code written in flex 4/4.5 using mx to be compatible with flex 4.5.1 using only spark.

The problem is that I c开发者_运维知识库an't find a few mx component in spark so any help will be appricated:

mx:tree

mx:text

alert.show()

Thanks


There is no Spark equivalent of MX Tree control in Flex SDK. But anyway this control is too "heavy" to use it in mobile apps considering resources (performance). I think you should rethink your GUI and introduce some lightweight version of it.

mx:Text can be replaced with s:Label or s:RichText depending on need you formatting or not. You can see features comparison table here.

Finally, Alert. There is no Spark equivalent of MX Alert out of the box. Spark architecture has SkinnablePopUpContainer which can be used to create your own alert with possibility to customize it for your application. For example to use iPad-like pop ups.

Update. There is some third party Spark Tree implemented.


I don't think there's any replacement for the MX tree. If you rally don't want to use it, you can check out this page :

http://cookbooks.adobe.com/post_Spark_Tree-17788.html

For the Text component, use either of the following depending on your needs (I suggest s:Label, it's much faster) :

http://help.adobe.com/en_US/flex/using/WS02f7d8d4857b1677-165a04e1126951a2d98-7fff.html

There's no Spark alert, but if you really can't use the mx control, use the PopUpManager to display any flex component as a popup and set the modal option to true. However, the TileWindow component is a really base popup component that you can extend if you need to. More infos on TileWindow :

http://help.adobe.com/en_US/flex/using/WS6c678f7b363d5da52e8f1ca1124a0430dcf-8000.html

Here's an example of using the PopUpManager :

        _legalPopup = new LegalMentionPopup();
        _legalPopup.title = "Legal Mention"

        PopUpManager.addPopUp(_legalPopup, FlexGlobals.topLevelApplication as DisplayObject, true);
        PopUpManager.centerPopUp(_legalPopup);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号