<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
applicationComplete="initApp()"
layout="vertical" xmlns:dataservice="dataservice.*" xmlns:forms="forms.*"
viewSourceURL="srcview/index.html">
<mx:Style source="cssflex/dgcbfilter.css" />
<mx:Metadata>
[ResourceBundle("myappli")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import events.GetCustomerEvent;
private function initApp():void
{
dataSvc.getListCustomers();
}
private function getPhpCustomers(event:GetCustomerEvent):void
{
dataSvc.getListCustomersWithPhp(event.max);
}
private function setLangFr():void
{
resourceManager.localeChain = ["fr_FR"];
}
private function setLangEn():void
{
resourceManager.localeChain = ["en_US", "fr_FR"];
}
]]>
</mx:Script>
<dataservice:DataService id="dataSvc"/>
<mx:ApplicationControlBar width="100%">
<mx:Label text="{resourceManager.getString('myappli','appli.title')}" styleName="applicationTitle"/>
<mx:Spacer width="100%" />
<mx:Image source="@Embed('/assets/flagfr.gif')" buttonMode="true" click="setLangFr()"
filters="{[new GlowFilter(0xFFFFFF, 0.9, 11, 11)]}" />
<mx:Spacer width="5" />
<mx:Image source="@Embed('/assets/flagenus.gif')" buttonMode="true" click="setLangEn()"
filters="{[new GlowFilter(0xFFFFFF, 0.9, 11, 11)]}" />
<mx:Spacer width="10" />
</mx:ApplicationControlBar>
<mx:ViewStack id="mainView" width="100%" height="100%" creationPolicy="all">
<forms:CustomerView id="customerView" getCustomers="getPhpCustomers(event)"/>
</mx:ViewStack>
</mx:Application>