How do I write a halt script vs an onComplete script?
I am having an issue with a swf playing over another swf. The stop audio portion of my ActionScript is occurring onComplete rather then a halt script action. This was not a problen when I tested locally since the files would download in 1 or 2 seconds instead of 8 to 12 seconds. Can someone tell me how to change the onComplete to a halt action? My script is below.
//run at once
var sRequest:URLRequest = new URLRequest("track01.swf");
var externalMovie:MovieClip;
var swfLoader:Loader = new Loader();
swfLoader.load(sRequest);
this.addChild(swfLoader);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
function onComplete(evtObj:Event):void{
externalMovie = MovieClip(swfLoader.content)
}
//------------------button code
this.addEventListener(MouseEvent.CLICK, onClick);
function onClick(evtObj:MouseEvent):void{
externalMovie.stop();
//this.removeChild(swfLoader);
//trace(evtObj.target.name)
var buttonClicked:String = evtObj.target.name;
swfLoader.load(new URLRequest(buttonClicked + ".swf"));
}