inquizard
May 26th, 2008, 09:18 AM
Hi,
I really need some help or advice if someone is able to help?
I'm trying to load an external swf into a holding swf, but keep gettting the 1009# error. I've been told that this is because the external swf reference's the stage in the "onEnterFrame" function & the stage is null whilst the loader in the holder swf is loading the external swf.
I've been offered also sorts of advice, but the main one is to delay the constructor until the swf is loaded fully. I've tried this; i've tried timers, "ADD_TO_STAGE" listeners and a few other things but i cant seem to sort it.
I could keep going in trying to find a solution, but i think i'm making some wrong assumptions about the coding which is throwing me in the wrong directions; the holder.swf has a enter button, which when clicked, begins the loading of the first external.swf into the loader. It does this fine and has no errors. It's when you click on one of the links to the other swfs that the problems begin. i dont understand how the loader can load the first external swf (which has references to the stage) with no problems, but every attempt to load an external swf from that point on creates issues? Is anyone able to offer any advice as i currently losing days to this...?
here's the code for the first external swf (the cripting for the other externals swfs are pretty much the same at this point:
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.net.URLRequest;
public class homePage extends MovieClip {
private var menu:welcomeClip;
public function homePage() {
this.addEventListener(Event.ADDED_TO_STAGE,stageAc tive);
}
private function init():void {
trace(parent);
menu = new welcomeClip();
addChild(menu);
addEventListener(Event.ENTER_FRAME,onEnterFrame);
}
function stageActive(evt:Event):void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
init();
trace("holder stage is " + parent);
stage.addEventListener(Event.RESIZE,resizeHandler) ;
}
function resizeHandler(evt:Event):void {
}
public function onEnterFrame(event:Event):void {
menu.x=stage.stageWidth / 2;
menu.y=stage.stageHeight / 2;
}
}
}
I really need some help or advice if someone is able to help?
I'm trying to load an external swf into a holding swf, but keep gettting the 1009# error. I've been told that this is because the external swf reference's the stage in the "onEnterFrame" function & the stage is null whilst the loader in the holder swf is loading the external swf.
I've been offered also sorts of advice, but the main one is to delay the constructor until the swf is loaded fully. I've tried this; i've tried timers, "ADD_TO_STAGE" listeners and a few other things but i cant seem to sort it.
I could keep going in trying to find a solution, but i think i'm making some wrong assumptions about the coding which is throwing me in the wrong directions; the holder.swf has a enter button, which when clicked, begins the loading of the first external.swf into the loader. It does this fine and has no errors. It's when you click on one of the links to the other swfs that the problems begin. i dont understand how the loader can load the first external swf (which has references to the stage) with no problems, but every attempt to load an external swf from that point on creates issues? Is anyone able to offer any advice as i currently losing days to this...?
here's the code for the first external swf (the cripting for the other externals swfs are pretty much the same at this point:
package {
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.net.URLRequest;
public class homePage extends MovieClip {
private var menu:welcomeClip;
public function homePage() {
this.addEventListener(Event.ADDED_TO_STAGE,stageAc tive);
}
private function init():void {
trace(parent);
menu = new welcomeClip();
addChild(menu);
addEventListener(Event.ENTER_FRAME,onEnterFrame);
}
function stageActive(evt:Event):void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
init();
trace("holder stage is " + parent);
stage.addEventListener(Event.RESIZE,resizeHandler) ;
}
function resizeHandler(evt:Event):void {
}
public function onEnterFrame(event:Event):void {
menu.x=stage.stageWidth / 2;
menu.y=stage.stageHeight / 2;
}
}
}