How to add event listeners in mxml components.



How to add event listeners in mxml components...

Answer / Pallavi Gangwar

To add event listeners in MXML components, you can use the creationComplete and click events for simple buttons. Here's an example of a button with an event listener:

<s:Button id="myButton" label="Click me!" click="handleClick()"/>

[Bindable]
public var myVariable:String;

private function handleClick(event:MouseEvent):void {
myVariable = 'New Value';
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Flash Action Scripting Interview Questions

Describe changewatcher.watch.

1 Answers  


which code should be added to create a second blue square to the right of the first? : Adobe flash

1 Answers  


in general, non-mp3 digital audio destined to be imported into the flash mx authoring environment should first be compressed how much? : Adobe flash

1 Answers  


Tell me what is the main purpose of actionscript?

1 Answers  


what happens when you drag an object created with the oval tool to the library panel? : Adobe flash

1 Answers  


what is the recommended character to use to separate target level paths levels? : Adobe flash

1 Answers  


Can you organize layers as in photoshop?

8 Answers  


you want to skin flash cs3 components. What should you do? : Adobe flash

1 Answers  


can some organizations block flash movies from being received through the internet? : Adobe flash

1 Answers  


which statement best describes what the #initclip num and #endinitclip commands indicate? : Adobe flash

1 Answers  


what are the correct statements consenting text field? : Adobe flash

1 Answers  


What are the ways in which actionscript's code can be protected?

1 Answers  


Categories