Hello there,
I am using a main .swf with buttons on a navigation menu that loads external .swf(s) - these load external videos (I use them as their backgrounds).
In the main .FLA I have used the following code (in the first and unique frame):
CODE
var Xpos:Number = 110;
var Ypos:Number = 180;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest(“swfs/eyesClosed.swf”);
loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Btns Universal function
function btnClick(event:MouseEvent):void {
removeChild(loader);
var newSWFRequest:URLRequest = new URLRequest(“swfs/” + event.target.name + “.swf”);
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
}
// Btn listeners
inicio.addEventListener(MouseEvent.CLICK, btnClick);
curriculum.addEventListener(MouseEvent.CLICK, btnClick);
portfolio.addEventListener(MouseEvent.CLICK, btnClick);
contacto.addEventListener(MouseEvent.CLICK, btnClick);
I have added the following code in the only frame the external .swf(s) have:
CODE
import flash.events.Event;
busto.addEventListener(Event.REMOVED_FROM_STAGE, onStageRemoved);
function onStageRemoved(e:Event):void
{
// kill all listeneres and running processes here.
}
I can make each button on the menu load each external .swf correctly with videos included - but when I leave that .swf using the navigation buttons to go to another section, the video and audio keep working in the background.
What am I doing wrong/have to change or add in the code?