Hi guys, been looking at the forum for a little while, but have only just encountered my first real problem in Flash CS4. This method worked for me previously, but doesnt work on this new client project for some reason!
This is the method I’m currently using to load external SWFs :
[SIZE=2]//////external swfs///////
var Xpos:Number = 110;
var Ypos:Number = 180;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest(“swfs/home.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
home.addEventListener(MouseEvent.CLICK, btnClick);
aboutus.addEventListener(MouseEvent.CLICK, btnClick);
services.addEventListener(MouseEvent.CLICK, btnClick);
equipment.addEventListener(MouseEvent.CLICK, btnClick);[/SIZE]
/////////////////
This code is meant to load each external SWF into my main flash file, but first it needs to load the default SWF, which is ‘home.swf’ - which as you can see is located in the ‘swfs’ folder
The problem is when it should automatically load the ‘home.swf’, it comes with the error message :
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
Does anyone know what the problem is ? I’m pulling my hair out cos it’s client work!!
Any help will be greatly appreciated.