TwelvestoneFlash

*cursed preloader


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
jverbal
 
2003-01-29

Ok, so im loading swf's into a movieclip in my mainmovie and displaying the percent loaded for the viewer. now this all works just fine on any PC i have tested, HOWEVER, it seems to return a negative number for a split second on macs.

this is the code i was using

sectionloader.onenterframe=function() { _root.p.percent = int((holder.getBytesLoaded()/holder.getBytesTotal())*100); }

i have changed it to this to try and not allow negative numbers to be displayed, but it still seems to do it.

sectionloader.onenterframe=function() { if(_root.p.percent<0) { _root.p.percent=0; }else{ _root.p.percent = int((holder.getBytesLoaded()/holder.getBytesTotal())*100); } } I feel as if there is a split second between the time the old movie unloads and the new one initializes and this is why im getting hte negative numbers, so what would be the best course of action folks?

should i restrict the textfield to NOT allow negatives?

sakri
 
2003-01-30

just ignore the mac people...

k

you should probably calculete the value of p first, and then check if it's zero like so:

sectionloader.onEnterFrame=function(){ var p=int((holder.getBytesLoaded()/holder.getBytesTotal())*100); if(p<0){ _root.p.percent=0; }else{ _root.p.percent = p; } }

this way you will never post a negative value

Voodoo192
 
2003-01-30

I have noticed this problem, it seems to be because the MAC takes a few moments to start loading the swf

The above should work, or you could try

sectionloader.onEnterFrame=function(){

                 if(holder.getBytesTotal()>0){

                     _root.p.percent=int((holder.getBytesLoaded()/holder.getBytesTotal())*100);

                  }

}

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

*cursed preloader