-
Senior Member
AS3 Preloading Issue, please help!
Hello again,
I have a MAIN swf with a preloader, and a loaded CONTENT swf with a preloader.
The preloading works fine as long as it s not cached in your browser.
The page is shown here....
http://www.sbdesigns.ca/tester/main.html
If you load the page the first time you will see both preloaders function
but if you view the page again after it has been cache the second preloader does not work, it doesn't go to frame2.
Here is the code for both preloaders and the source files are attached.
http://www.sbdesigns.ca/tester/Archive.zip
Actionscript Code:
//Import the required assets import flash.display.*; //Stop the playhead while loading occurs stop();
//Create a listener to call the loading function as the movie loads loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);
//This is the main function, basically it grabs the total and loaded bytes, //calculates a percentage, and displays it by stretching the bar and adjusting //the textfield display. If your bar/textbox instancenames are NOT lbar/lpc, //you'll need to adjust this code to match your instance names function PL_LOADING(event:ProgressEvent):void { var pcent:Number=event.bytesLoaded/event.bytesTotal*100; //Stretch the bar // lbar_mc.lbar.scaleY=pcent/100; //Display the % loaded in textfield lpc.text=int(pcent)+"%"; //If the movie is fully loaded, kick to the next frame on the main timeline //You may wish to change the gotoAndStop(2) to a gotoAndPlay(2) if (pcent==100) { gotoAndStop(2); } }
Please help, any is appreciated :-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|