
TUTORIALS POINT
Simply Easy Learning Page 20
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
protected function btnClickMe_clickHandler(event:MouseEvent):void
{
Alert.show("Hello World!");
}
protected function application_initializeHandler(event:FlexEvent):void
{
lblHeader.text = "My Hello World Application";
}
]]>
</fx:Script>
<s:BorderContainer width="500" height="500" id="mainContainer"
styleName="container">
<s:VGroup width="100%" height="100%" gap="50" horizontalAlign="center"
verticalAlign="middle">
<s:Label id="lblHeader" fontSize="40" color="0x777777"
styleName="heading"/>
<s:Button label="Click Me!" id="btnClickMe"
click="btnClickMe_clickHandler(event)" styleName="button" />
</s:VGroup>
</s:BorderContainer>
</s:Application>
You can create more mxml or actionscript files in the same source directory to define either new applications or to
define helper routines.
Step 6 - Build Application
Flash Builder has Build Automatically by default checked. Just check the Problems View if there is any error.
Once you are done with the changes, you will not see any errors.
Step 7 - Run Application
Now click on Run application menu and select HelloWorld application to run the application.
If everything is fine, you must see browser pop up and application up and running. If everything is fine with your
application, this will produce following result: [ Try it online ]
Commentaires sur ces manuels