Hi everyone,
I’m currently trying to move from flash CS4 to flex 3.
When I create an AS class and want to use a component in CS4 i import a component:
import fl.controls.Button;
and make sure that the button component is in the library of the .fla file which calls the AS class.
Now I’m trying to do something similar in flex 3. I can import the component in AS:
<mx:Application
xmlns:mx=“http://www.adobe.com/2006/mxml”
creationComplete=“init()”
>
<mx:Script>
<![CDATA[
import mx.controls.Button;
public function init():void {
var asButton:Button = new Button();
asButton.label = "ActionScript 3 Button";
this.rawChildren.addChild(asButton);
}
]]>
</mx:Script>
but when i try to add it to the display it doesn’t exist. Is this because it’s not in the library? It doesn’t throw an error, but doesn’t get added to the display.
Is there a walk-though about adding a component from within AS3 in flex 3? I’m completely stuck here.
kenneth