<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:components="components.*" layout="absolute" backgroundColor="#000000" initialize="onInitialize()" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import events.SlideshowNavigationBarEvent;
private function onInitialize():void
{
mySlideshowNavigationBar.addEventListener(
SlideshowNavigationBarEvent.PREVIOUS_CLICK, onPrevClick);
mySlideshowNavigationBar.addEventListener(
SlideshowNavigationBarEvent.NEXT_CLICK, onNextClick);
mySlideshowNavigationBar.addEventListener(
SlideshowNavigationBarEvent.PLAY_CLICK, onPlayClick);
mySlideshowNavigationBar.addEventListener(
SlideshowNavigationBarEvent.FULLSCREEN_CLICK, onFullScreenClick);
mySlideshowNavigationBar.addEventListener(
SlideshowNavigationBarEvent.SOUND_CLICK, onSoundClick);
mySlideshowNavigationBar.isPlaying = true;
mySlideshowNavigationBar.isFullScreen = false;
mySlideshowNavigationBar.isSoundOn = true;
}
private function onPrevClick(event:SlideshowNavigationBarEvent):void
{
myTextArea.htmlText += "Go to previous slide.<br>";
}
private function onNextClick(event:SlideshowNavigationBarEvent):void
{
myTextArea.htmlText += "Go to next slide.<br>";
}
private function onPlayClick(event:SlideshowNavigationBarEvent):void
{
if (mySlideshowNavigationBar.isPlaying == true)
{
mySlideshowNavigationBar.isPlaying = false;
myTextArea.htmlText += "Pause slideshow.<br>";
}
else
{
mySlideshowNavigationBar.isPlaying = true;
myTextArea.htmlText += "Play slideshow.<br>";
}
}
private function onFullScreenClick(event:SlideshowNavigationBarEvent):void
{
if (mySlideshowNavigationBar.isFullScreen == true)
{
mySlideshowNavigationBar.isFullScreen = false;
myTextArea.htmlText += "Go to small screen.<br>";
}
else
{
mySlideshowNavigationBar.isFullScreen = true;
myTextArea.htmlText += "Go to full screen.<br>";
}
}
private function onSoundClick(event:SlideshowNavigationBarEvent):void
{
if (mySlideshowNavigationBar.isSoundOn == true)
{
mySlideshowNavigationBar.isSoundOn = false;
myTextArea.htmlText += "Turn sound off.<br>";
}
else
{
mySlideshowNavigationBar.isSoundOn = true;
myTextArea.htmlText += "Turn sound on.<br>";
}
}
]]>
</mx:Script>
<mx:HBox width="100%" horizontalAlign="center">
<mx:TextArea id="myTextArea" width="500" height="400"/>
</mx:HBox>
<mx:HBox width="100%" horizontalAlign="center" bottom="60">
<components:SlideshowNavigationBar id="mySlideshowNavigationBar"/>
</mx:HBox>
</mx:Application>