Wow you are in flex coding part
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Button id="button1" label="Click me" x="100" y="100" />
</mx:Application>
this is way for creating button in flex we have given
id name which is used to refer the button later in actionscript or mxml
Label is the text displayed in Button
Then x y values to position button
Handling Events
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import flash.net.URLLoader;
import flash.net.URLRequest;
public function launch(evt:MouseEvent):void{
navigateToURL(new URLRequest("http://sara-intop.blogspot.com"));
}
]]>
</mx:Script>
<mx:Button id="button1" label="Click me" x="100" y="100" click="launch(event)"/>
</mx:Application>
Here we are going to write our button handler using Actionscript using mx:script tag
we are calling launch method in click event.
and navigating to url similar to getURL in flash8
0 comments:
Post a Comment