Setting Triggers With ActionScript
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()">
<mx:Script>
import mx.controls.Image;
import mx.effects.Fade;
private var myImage:Image = new Image();
private function initApp():void{
this.addChild(myImage);
myImage.source = "logo.jpg";
myImage.x=150;
myImage.y=100;
myImage.setStyle("showEffect", new Fade());
myImage.setStyle("hideEffect", new Fade());
}
</mx:Script>
<mx:Button x="150" y="375" label="Show Image" click="myImage.visible=true"/>
<mx:Button x="374" y="375" label="Hide Image" click="myImage.visible=false"/>
</mx:Application>
Related examples in the same category