//ADD the listener
private function onCreationComplete():void
private function cancel(event:MouseEvent):void
// do something
Thank's for the reply, but I need to reference it from a seperate actionscript class. This button will have to control a sprite (rectangle) that I add using actionscript. Is there any way of achiving this?
Try to post some of your sample code depicting your problem...
1 person found this helpful
All you need is a reference to the instance of the MXML you wish to access...
Let's say your Button has the id "myButton" in the MXML, and your MXML instance is called myMxmlComponent.
All you need to do to access the button from the AS3 is:
If you do not have a reference to the MXML, you will probably need to access it from the Application.application, which refers to your project's main MXML.
Thanks, the Application.application approach works
I imported mx.core.Application;
and used it to reference the button on the stage