Define effect in MXML, use ActionScript to apply it
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initializeEffect(event);">
<mx:Script>
import flash.events.Event;
private function initializeEffect(eventObj:Event):void {
myB.setStyle("mouseDownEffect", myWL);
}
</mx:Script>
<mx:WipeLeft id="myWL" duration="1000" />
<mx:Button id="myB" />
</mx:Application>
Related examples in the same category