Preloader pls help

Hi all I have a burning question that I really need an answer

Basically, I have a preloader and I want it to load each section when it is called with this code:

callback function///////////////////////////////////////////////////////////////////////////////// ///////////

caps_mc.btn_continue_mc.addEventListener (MouseEvent.CLICK, nextpls);

function nextpls(e:MouseEvent):void {}
MovieClip (parent.parent) .nextSWF ("home page", parent);
}

the code above shows the preloader is finished with the home page and in the preloader, it should then load faq,

but I get an error saying that nextSWF is not a function when it is clearly,

It is even possible to use a preloader to load SWFs in this way?

preloader///////////////////////////////////////////////////////////////////////////////// //////////////////////

import flash.display. *;
import flash.events. *;
import flash.net.URLRequest;

var loadedSWF:Loader
var progressPercent:Number;

function startLoad(SWFName:String):void {}
loadedSWF = new Loader();
loadedSWF.contentLoaderInfo.addEventListener (Event.COMPLETE, gameLoaded);
loadedSWF.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, onProgressHandler);
loadedSWF.load (new URLRequest (SWFName + ".swf"));

}
follow the progress
function onProgressHandler(loadingProgress:ProgressEvent) {}

var p: Number = loadingProgress.bytesLoaded/loadingProgress.bytesTotal;

progressPercent = Math.round ((percent*100));
preload_mc.gotoAndStop (progressPercent);
preload_mc.myloadtext_txt. Text = (progressPercent + '%')
preload_mc.myloadbar_mc. ScaleX = %;
preload_mc.mc_mask. Height =(progressPercent * 3).
preload_mc.ofBytes_txt. Text = loadingProgress.bytesLoaded + "bytes."
preload_mc.totalbytes_txt. Text = loadingProgress.bytesTotal + "bytes."

}

function gameLoaded(e:Event):void {}

removeChild (preload_mc);
this.addChild (loadedSWF);

loadedSWF.contentLoaderInfo.removeEventListener (Event.COMPLETE, gameLoaded);
loadedSWF.contentLoaderInfo.removeEventListener (ProgressEvent.PROGRESS, onProgressHandler);
}
function nextSWF (whichSWFName, removeSWF) {}
this.removeChild (removeSWF.parent);
If (whichSWFName == "startPages") {}
startLoad ("faq");
}

}
startLoad ("startPages");

////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////

Here is the error

TypeError: Error #1006: nextSWF is not a function.
at startPages_fla::MainTimeline/nextpls() [startPages_fla. MainTimeline::frame1:7]

If anyone can help I would be very grateful, I'm hoping to be able to have a reusable preloader

Thanks in advance

fonzio

is startPage() in frame 1 of the main timeline of your main swf?

If so, what show the following trace():

caps_mc.btn_continue_mc.addEventListener (MouseEvent.CLICK, nextpls);

function nextpls(e:MouseEvent):void {}

trace (MovieClip (parent.parent);
MovieClip (parent.parent) .nextSWF ("home page", parent);
}

Tags: Adobe Animate

Similar Questions

Maybe you are looking for