- I posted this on another forum but no help so far. Kirupa has always been the most responsive in the past so I should have tried here first! *
Hey all, It’s been a while since I’ve posted and/or used Flash, and it seems I’m a bit rusty because I can’t get my preloader to work. I’ve searched google for tips and other methods on the way I am doing it, and I really have spent a lot of time trying all kinds of different ways/code, but I can’t get it to work correctly.
I will post my .FLA so you can see what I am doing. I’d like the preloader graphic to unmask itself from left to right (obviously), but I’m not even sure if the code for the mask-movieclip is correct.
Here is my code (no errors on the compiler):
stop();
mask_mc._width = 1;
this.onEnterFrame = function():Void{
var lBytes = _root.getBytesLoaded();
var tBytes = _root.getBytesTotal();
var percent = Math.floor((lBytes/tBytes)*100);
mask_mc._xscale = percent;
text_txt.text = percent + " %"
if(lBytes >= tBytes){
gotoAndPlay(2);
}
I think the mask_mc code is correct? I’d like it to start at 1 width and expand to 100 as the progress happens.
One problem I have is that when I try to “Simulate Download” on slower speeds to test it out, my screen just goes white and nothing happens. Yet I can still ‘Test Movie/Scene’ fine.
If anyone could take a look at my file and give me some hints, I would really appreciate it! thanks,
http://www.lindesigns.us/flashloadertest.fla
-Hrl2k