ForumsProgramming ForumPreloader doesn't work

17 7789
klianc09
offline
klianc09
4 posts
Jester

I have currently programmed my first game, but now I have a problem.

It has a size of 100 KB and I thought it would be great to have a preloader for that.

But the flash movie gets loaded before the preloader starts which takes the idea out of the preloader.

I have just two frames on my main timeline with the first empty and the code for the preloader and my second frame contains an empty movie clip with the AS that attaches the movie clips from the library.

Can anybody help me? Or do I not really need a preloader for a 100 KB big game? Because with DSL it loads within a few seconds.

Here is my Preloader script:

_root.stop();
_root.attachMovie(&quotreload",&quotreload",1);
_root.preload._x = Stage.width/2;
_root.preload._y = Stage.height/2;
onEnterFrame = function () {
geladen = Math.floor(getBytesLoaded());
gesamt = Math.floor(getBytesTotal());
pro = Math.floor(geladen/gesamt*100);
_root.preload.loaded.text = geladen;
_root.preload.total.text = gesamt;
_root.preload.prozent.text = pro;
_root.preload.preloader.gotoAndStop(pro+1);
if (pro>=100) {
trace("Hello"
_root.nextFrame();
delete onEnterFrame;
removeMovieClip(_root.preload);
}
};

  • 17 Replies
driejen
offline
driejen
486 posts
Nomad

I have never used that extension my self, so you'll have to figure it out yourself if you want to use it.

Drag a bit map from the library on to the stage. Select it and hit F8, give it a name. Use this name to call the symbol in actionscript rather than the name of the bitmap. Hit delete to remove the new symbol from the stage.

Showing 16-16 of 17