LinkButton using ActionScript
August 12, 2009 at 11:40 am | Posted in Flex | Leave a commentIntroduction:
From this simple Flex Example, one can easily understand about ActionScript. Try this in your own way and learn more.
Source Code:
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” creationComplete=”createbutton();”>
<mx:Script>
<![CDATA[
import mx.controls.LinkButton;
import mx.controls.Image;
var link:LinkButton;
var image1:Image;
public function createbutton():void{
link=new LinkButton;
link.label= "Pa.Vijay";
link.width=100;
link.height=25;
link.x=50;
link.y=50;
this.addChild(link);
link.addEventListener(MouseEvent.CLICK,showimage);
}
public function showimage(event:MouseEvent):void{
image1=new Image;
image1.source="../Assets/Pa.Vijay.jpg";
image1.maintainAspectRatio=false;
image1.width=50;
image1.height=50;
image1.x=60;
image1.y=80;
this.addChild(image1);
}
]]>
</mx:Script>
</mx:Application>
Screenshots:
Thanks & Regards,
Kasi Ruby.R
Leave a Comment »
RSS feed for comments on this post. TrackBack URI
Leave a Reply
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

