Applying behaviors in ActionScript using styles
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="createEffect(event);"> <mx:Script> import flash.events.Event; import mx.effects.Zoom; private function createEffect(eventObj:Event):void { var zEffect:Zoom = new Zoom(); zEffect.duration = 2000; zEffect.zoomHeightTo = 3.50; zEffect.zoomWidthTo = 1.50; myB.setStyle("mouseDownEffect", zEffect); } </mx:Script> <mx:Button id="myB" /> </mx:Application>