It is not possible to use Flex components in pure Actionscript project officially. But there are times when you want to use them because they are easier to create or control such as DataGrid or DateChooser…
Here are some hints that might help you to use Flex components in Actionscript project:
1. You need to create a main application mxml document that can initialize your main entry class via “applicationComplete()” method, e.g-
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="Main.init()"> </mx:Application>
2. If you have added sprites or movie clips to the stage, you will need to add them to flex main application instead via “UIComponent” or “Application.application.rawChildren”, e.g-
import mx.core.Application; import mx.core.UIComponent; var app:Application = Application(Application.application); var mc:MovieClip = new MovieClip(); var ui = new UIComponent(); ui.addChild(mc); app.addChild(ui); // or app.rawChildren.addChild(mc);
Remember to import the Flex control library if you want to use the components.
No user commented in " Using Flex Components in Actionscript Project "
Follow-up comment rss or Leave a TrackbackLeave A Reply