<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
backgroundGradientColors="[#ffffff, #ffffff]"
creationComplete="init();" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
/**
* * * * * * * * * * * * * * * * *
* Sean Moore *
* www.seantheflashguy.com/blog *
* seantheflashguy@gmail.com *
* * * * * * * * * * * * * * * * *
* 09/28/07
* Basic Flex to Flash CS3 communication test.
* Note: The Flash CS3 FLA must be set to
* Flash Player 9 and the AS version must be
* ActionScript 3.0 in the File -> Publish Settings
*/
private var loadedSWFMainTimeline:*;
private var animhorse_mc:MovieClip;
private function init():void
{
}
private function onAnimhorseSWFCompleted(event:Event):void
{
loadedSWFMainTimeline = animhorseSWF.content;
loadedSWFMainTimeline.setFlashText("Click the Flex Buttons to animate the Flash CS3 horse MovieClip.");
animhorse_mc = loadedSWFMainTimeline.animhorse_mc;
}
private function onStepForwardBtnClicked(event:MouseEvent):void
{
if (animhorse_mc) {
animhorse_mc.nextFrame();
}
}
private function onStepBackBtnClicked(event:MouseEvent):void
{
if (animhorse_mc) {
animhorse_mc.prevFrame();
}
}
]]>
</mx:Script>
<mx:SWFLoader id="animhorseSWF"
y="75"
source="images/Animhorse.swf"
horizontalCenter="0"
complete="onAnimhorseSWFCompleted(event);"/>
<mx:Button id="stepForwardBtn"
y="328"
label=">>"
horizontalCenter="39"
click="onStepForwardBtnClicked(event);"/>
<mx:Button id="stepBackBtn"
y="328"
label="<<"
horizontalCenter="-41"
click="onStepBackBtnClicked(event);"/>
</mx:Application>