<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
viewSourceURL="srcview/index.html"
pageTitle="GAFF - demo 01"
layout="absolute">
<mx:Script>
<![CDATA[
import com.remitoffoli.gaff.PageTracker;
import mx.events.IndexChangedEvent;
private var pageTracker:PageTracker = PageTracker.getPageTracker();
[Bindable]
private var description:String =
"This Flex application\n" +
"is the first demonstration of\n" +
"<b>GAFF (Google Analytics For Flex/Flash)";
private function tabNavigator_changeHandler(event:IndexChangedEvent):void
{
var pageURL:String =
"/GAFFDemo01" +
"/category" + tabNavigator.selectedIndex;
pageTracker._trackPageview(pageURL);
lastTrackerCall.text = "pageTracker._trackPageview('" + pageURL + "');";
}
private function accordion_changeHandler(event:IndexChangedEvent):void
{
var pageURL:String =
"/GAFFDemo01" +
"/category" + tabNavigator.selectedIndex +
"/page" + accordion.selectedIndex;
pageTracker._trackPageview(pageURL);
lastTrackerCall.text = "pageTracker._trackPageview('" + pageURL + "');";
}
]]>
</mx:Script>
<mx:VBox
horizontalCenter="0"
verticalCenter="0">
<mx:Text
htmlText="{description}"
width="100%" fontSize="20" />
<mx:TabNavigator
id="tabNavigator"
width="600" height="400"
change="tabNavigator_changeHandler(event)">
<mx:VBox label="category n°1">
<mx:Text text="Content of category n°0" />
</mx:VBox>
<mx:VBox label="category n°2">
<mx:Text text="Content of category n°1" />
</mx:VBox>
<mx:VBox label="category n°3">
<mx:Text text="Content of category n°2" />
<mx:Accordion
id="accordion"
width="100%" height="100%"
change="accordion_changeHandler(event)">
<mx:VBox label="page n°0"><mx:Text text="Content of page n°1" /></mx:VBox>
<mx:VBox label="page n°1"><mx:Text text="Content of page n°2" /></mx:VBox>
<mx:VBox label="page n°2"><mx:Text text="Content of page n°3" /></mx:VBox>
<mx:VBox label="page n°3"><mx:Text text="Content of page n°4" /></mx:VBox>
</mx:Accordion>
</mx:VBox>
</mx:TabNavigator>
<mx:ApplicationControlBar
width="100%"
fillAlphas="[1.0,1.0]">
<mx:Label
text="last tracker call :"
fontWeight="bold" />
<mx:Label
id="lastTrackerCall"
width="100%" />
</mx:ApplicationControlBar>
<mx:HBox
width="100%"
horizontalAlign="right">
<mx:LinkButton
label="view source"
click="navigateToURL(new URLRequest(viewSourceURL),'_blank')" />
<mx:LinkButton
label="project's page"
click="navigateToURL(new URLRequest('http://code.google.com/p/gaff/'),'_blank')" />
<mx:LinkButton
label="remitoffoli.com"
click="navigateToURL(new URLRequest('http://www.remitoffoli.com'),'_blank')" />
</mx:HBox>
</mx:VBox>
</mx:Application>