FORUMS: list search recent posts

make preloader disappear

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Michael Paul
make preloader disappear
on Sep 4, 2011 at 3:30:12 pm

this is AS2

I've got a movie with a menu : play movie - extras - and a preloader on top of that with a loading bar.

you cant click on "play movie" but if you click on extras you will go to the next frame and then you can navigate in the extras which are always a bunch of new key frames.

on top of that you still have the preloader which is one constant keyframe.

once the movie has loaded it will jump to a frame that tells you the movie has loaded. now here is the problem: because of that code that jumps to the frame you aren't able to go back to extras anymore because every time you do and the movie is loaded it will jump to that "MOVIE LOADED" screen - of course.

now here is my idea: the preloader and it's code is only active if the movie is still loading for the first time ever. once it jumps to that MOVIE LOADED screen I toggle some value / set false to true or whatever just to check if movie fully loaded is activated and the next time I go to extras the preloader won't be there anymore.

Does this make any sense to you? am I expressing myself right because I suck at AS?

here is the preloader coder which is on one keyframe btw:

loadingBar._xscale = 1;
var loadingCall:Number = setInterval(preloadSite, 50);
function preloadSite():Void {
var siteLoaded:Number = _root.getBytesLoaded();
var siteTotal:Number = _root.getBytesTotal();
var percentage:Number = Math.round(siteLoaded/siteTotal*100);
loadingBar._xscale = percentage;
percentClip.percentDisplay.text = percentage + "%";
percentClip._x = loadingBar._x + loadingBar._width;
bytesDisplay.text = "loaded " + siteLoaded + " of " + siteTotal + " bytes";
if (siteLoaded >= siteTotal) {

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved