Adobe Flex Actionscript Question:
Download Questions PDF

Explain the difference between creating an effect and setting the target as opposed to adding an effectListener?

Answer:

To create a behavior, you define a specific effect with a unique ID and bind it to the trigger.
For example, the following code creates two zoom effects: one for shrinking the component slightly, and one for reverting it to its original size. These effects are assigned, by using their unique IDs, to the mouseDownEffect and mouseUpEffect triggers on the Button component.
<mx:Application ...>
<mx:Zoom id="shrink" duration="100" zoomHeightTo=".9" zoomWidthTo=".9" />
<mx:Zoom id="revert" duration="50" zoomHeightTo="1" zoomWidthTo="1" />
<mx:Panel title="Bouncy Button" paddingTop="10" paddingBottom="10"
paddingLeft="10" paddingRight="10" autoLayout="false" left="41" top="24" right="42">
<mx:Button id="bouncyButton" label="Click me!"
mouseDownEffect="{shrink}" mouseUpEffect="{revert}"/>
</mx:Panel>
</mx:Application>

Download Adobe Flex Actionscript Interview Questions And Answers PDF

Previous QuestionNext Question
What is the problem with calling setStyle()How do we identify a component created in a repeater using flex?