
TUTORIALS POINT
Simply Easy Learning Page 11
Public resources
These are helper files referenced by Flex application, such as Host HTML page, CSS or images located under
html-template folder.It contains following files
index.template.html
Host HTML page, with place holders. Flash Builder uses this template to build actual page
HelloWorld.html with HelloWorld.swf file.
playerProductInstall.swf
This is a flash utility to install Flash Player in express mode.
swfobject.js
This is the javascript responsible to check version of flash player installed and to load HelloWorld.swf in
HelloWorld.html page.
html-template/history
This folder contains resources for history management of the application.
HelloWorld.mxml
This is the actual MXML/AS (ActionScript) code written implementing the business logic of the application and that
the Flex compiler translates into SWF file which will be executed by flash player in the browser.A sample
HelloWorld Entry class will be as follows:
<?xml version="1.0" encoding="utf-8"?>
<s:Applicationxmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%"height="100%"
minWidth="500"minHeight="500"
initialize="application_initializeHandler(event)">
<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:VGrouphorizontalAlign="center"width="100%"height="100%"
paddingTop="100"gap="50">
<s:Labelid="lblHeader"fontSize="40"color="0x777777"/>
<s:Buttonlabel="Click Me!"id="btnClickMe"
click="btnClickMe_clickHandler(event)"/>
</s:VGroup>
</s:Application>
Kommentare zu diesen Handbüchern