views:

379

answers:

1

all i need is a preloader to run and when it detects the swf is loaded it will stop and the map.swf will start to run. I have trawled the net for weeks with no luck. I have a massive 776kb flash map. I need a preloader to run prior to this map but it need to be a preloader independant of the map.swf. Please does anyone have any ideas at all. i really would appreciate some help. thanks in advance

A: 

okay found it:http://actionscripts.org/forums/showthread.php3?t=74988&highlight=preloader+tutorial+MX+2004

stop();

//----- //-------------preloader------ //make the preloader bar not appear "full" right away bar_mc._xscale = 0; //load Movie into level 1 loadMovieNum("yourMovie.swf", 1); //please note the movie to load has a blank first frame. _level1.stop(); onEnterFrame = function () { // get the bytes of Level 1 and make into a percent percent = Math.ceil((_level1.getBytesLoaded()/level1.getBytesTotal())100); //use the percent to determine the xscale of the preloader bar. bar_mc._xscale = percent; // if loaded play level1 if (percent>99) { //note you MUST delete onEnterFrame otherwise it //will continue to run and play just frame 2 forever. delete this.onEnterFrame; _level1.gotoAndPlay(2);

}

};

basically this is completely separate to my main external swf.. Just make sure you put it in the same folder and call it with all the file structure intact otherwise it will not work. And it is the same height and width as the external swf i am calling - I have replaced the frame to play to go to frame 1 because that is where a load of my code starts from in the external fla. Works a treat. Also the last reference with a frame number (2) i have change to frame 1 also so it plays from start of externa swf. cool.....

miss_j2000