I hope that I am not too confusing. I have a swf that loads onto the page. Within that swf is a movieclip named swfContainer. I have 4 swfs that dynamically load into that container randomly on refresh. I have a pause button named pauseControl that is in the swf that loads onto the page (not inside the dynamically loaded swfs). So I need pauseControl to talk to the swf loaded inside the movieclip. Currently the pauseControl is commented out until it is working. Thank you so much.
Here is my actionscript:
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.MovieClip;
import flash.events.MouseEvent;
var myLoader:Loader = new Loader();
var swfArray:Array = new Array("http://URLREMOVED/swf_0.swf", "http://URLREMOVED/swf_1.swf", "http://URLREMOVED/swf_2.swf", "http://URLREMOVED/swf_3.swf");
// Sets the number of files in the random sequence
// IMPORTANT: Set this number to how many swfs you have
var swfNumber = 4;
// Creates a random number:
var randomNumber = Math.floor(Math.random()*swfNumber);
var selectswf = swfArray[randomNumber];
var loadswfURL:URLRequest = new URLRequest(swfArray[randomNumber]);
myLoader.load(loadswfURL);
myLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult);
var loadProgress_txt:TextField = new TextField();
loadProgress_txt.x = 484;
loadProgress_txt.y = 76;
loadProgress_txt.autoSize = TextFieldAutoSize.LEFT;
var loadingTextFormat:TextFormat = new TextFormat();
loadingTextFormat.font = "Trebuchet";
loadingTextFormat.color = 0xffffff;
loadingTextFormat.size = 16;
loadProgress_txt.defaultTextFormat = loadingTextFormat;
addChild(loadProgress_txt);
function showPreloader(evt:Event):void {
addChild(loadProgress_txt);
}
function showProgress(evt:ProgressEvent):void {
loadProgress_txt.text = "loaded: "+evt.bytesLoaded+" from "+evt.bytesTotal;
}
function showLoadResult(evt:Event):void {
removeChild(loadProgress_txt);
swfContainer.addChild(myLoader);
}
//controlBox
//controlBox.addEventListener(MouseEvent.ROLL_OVER, activateControlBox);
//controlBox.addEventListener(MouseEvent.ROLL_OUT, hideControlBox);
//controlBox.addEventListener(MouseEvent.CLICK, onClickHandler);
//controlBox.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
//controlBox.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
//use hand cursor
//controlBox.buttonMode = true;
//controlBox.useHandCursor = true;
//function activateControlBox(evt:MouseEvent):void{evt.target.gotoAndPlay("_over");}
//function hideControlBox(evt:MouseEvent):void{evt.target.gotoAndPlay("_up");}
//function onClickHandler(evt:MouseEvent):void{}
//function onPressHandler(evt:MouseEvent):void{}
//function onReleaseHandler(evt:MouseEvent):void{}
//end controlBox
//pauseControl
//controlBox.myControls.pauseControl.addEventListener(MouseEvent.MOUSE_UP, onClickPause);
//function onClickPause(evt:MouseEvent):void{trace(swfContainer.content);}
//end pauseControl