This content has been marked as final. Show 4 replies
Well sometimes it takes a moment to get proper numbers for the getBytesLoaded/Total. They can also for a moment jump to something like -1 or -4 (I can't remember exactly which!) So…
will give, tada, 100. The easy solution is:
if(percentage >=99 && kBytesLoaded > 0)
wow. Thank you VERY much. I spent many hours banging my head against the wall on this one, feeling too embarassed to post. Should have done so sooner. It would've saved me a lot of time. Thanks again!
Glad that worked out for you.
Remember that Flash does what you tell it, not what you want. So to diagnose these things for yourself you need to assume that is the case.
In this case if the conditional was evaluating you must have been getting the percentage as bigger than 99 and since you were using Math.round it must have been 100.
The next question would then be, "What else can equal 100%?" And from there you would of course have wanted to see what values you were getting for the getBytesLoaded/Total.
Of course sometimes it is hard to see the forest for the trees, but just take whatever conclusions you can make to their extreme and test them out!
Again, I much appreciate your help. I had put some trace statements in trying to find out what getBytesLoaded/Total were and they were coming back with values I didn't understand, so I kept thinking it was trying to get the values of the empty_mc I had instantiated instead of the thing I was trying to load and I kept scratching my head as to why and tried a lot of different things and was baffled. At any rate, in the end I think it's a timing issue if I understand correctly. In other words, I think the function started executing before it could really grab the correct information about the .swf that I was trying to load. Is that right?
Oh well, I'm out of the ditch with that silly problem now and moving on to my next set of challenges. :-)
Again, thank you so VERY much for being a willing helping hand to us newbies out here.