Ok so I have a main.swf that loads in swfs (home.swf, about.swf, etc). When I first load in home.swf and I click about. How do I get that to load in to main.swf. I have looked everywhere for this here is my code:
var request:URLRequest = new URLRequest("home.swf");
var loader:Loader = new Loader();
var loader_mc:mcLoader = new mcLoader();
addChild(loader_mc);
loader_mc.x = 441.3;
loader_mc.y = 257.8;
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.target.bytesLoaded/event.target.bytesTotal;
loader_mc.bar_mc.scaleX = percentLoaded;
loader_mc.myTextField_txt.text = Math.round(percentLoaded*100)+"%"
}
function loadComplete(event:Event):void {
trace("Complete");
}
//function loadComplete2(event:Event):void {
// trace("Complete");
//}
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, alldone);
function alldone(myevent:Event):void {
addChild(loader);
removeChild(loader_mc)
}
loader.load(request);
addChild(loader);
Everything works fine but my main issue is being able to click on a button in the home.swf removing home.swf and loading in the new swf in its place. If anyone can point me in the right direction I would appreciate it I have been looking for weeks now and still cant find anyone running into the same problem. Thanks in advanced.
Craig