Rather than deal with trying to figure out the passing of parameters to an embedded SWF, I went ahead and made 20 SWF's all compiled with different values. These SWF's are now inside my Flash Builder application.
There is a state for each SWF (using includeIn) so when the user clicks the button to switch states, the appropriate SWF is displayed.
The problem is that when a user views an SWF, it remains loaded and running in the background. I would like to unload the viewed SWF when the user leaves the state and then load it when it is needed again. If this is not possible, then I will settle for simply reloading the SWF when the state is entered, and just leave the other 19 running in the background.
I have the following:
<fx:Script><![CDATA[
private var flashMovie1:MovieClip;
private var flashMovie2:MovieClip;
private function initFirst():void{
flashMovie1 = dmp_first.content as MovieClip;
}
private function initSecond():void{
flashMovie2 = dmp_second.content as MovieClip;
}
protected function btnFirst_clickHandler():void
{
flashMovie2.Stop();
currentState='First';
flashMovie1.Play();
}
protected function btnSecond_clickHandler():void
{
flashMovie1.Stop();
currentState='Second';
flashMovie2.Play();
}
]]></fx:Script>
<mx:SWFLoader id="dmp_first" includeIn="First" source="assets/images/dmp_first.swf" complete="initFirst()"/>
<mx:SWFLoader id="dmp_second" includeIn="Second" source="assets/images/dmp_second.swf" complete="initSecond()"/>
Along with the above code not working at all with the Stop and Play, I still can't figure out how to force an SWF to reload. Any help would be greatly appreciated!