Flex Effects in Actionscript

13 02 2008

Ok, so there are a few things to keep in mind with applying events in ActionScript.

Firstly, when you want to add an effect to a custom component, you need to attach it to an Event. You’ll need the Event and the Effect metatags.

    //Handle the step event
Event(name=“step”, type=“flash.events.Event”)]
Effect(name=“stepEffect”, event=“step”)]

By dispatching the event, you will call the effect also.

Secondly, and which is somewhat unintuitive, is to set an effect with Actionscript, you set it like a style.


So, in the example above, we are inside our custom component, passing-on a custom effect to the built-in effect “addedEffect”.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: