This content has been marked as final. Show 5 replies
What if you place the stop(); at the bottom of your code? Maybe try taking it out of the function. This may make no difference, but it might be worth a try.
Oh there are so many things wrong with this.
First move the stop outside of your onEnterFrame. There is no need for it to execute a stop 30 times a second (or whatever your frame rate is). stop will stop you so no need for more.
Next move your loadMovie outside of the onEnterFrame. Again there is no need to start loading your movie 30 times a second and in fact if you restart 30 times a second you will just keep starting again and again.
Next you need to be careful because sometimes when a movie first starts to load you can get car and tot to both be zero. So in that case yes they are equal, but no you aren't finished. So add something like
if(car == tot && tot>12)
Finally unless you are publishing for Flash 6 or earlier you might want to use the MovieClipLoader class. It wraps up all this checking and stuff in a nice easy wrapper and you can just listen for the onLoadInit event to know that you are ready to go.
Rothrock is right about the timing. It often takes Flash time to catch up to your AS. 12 bytes is seen a lot. Either put in extra traps as Rothrock suggests (and you might even need more - especially if components are involved) or else always allow a slight delay after loading begins before you begin checking.
Thanks. How do I check those data I uploaded if the trace is wrong?
I need to use Flash 6.
Okay, you can't use MovieClip loader, but everything else I said before that paragraph is the answer.
Move stop and loadmovie outside your onEnterFrame and change your conditional to what I said. That should do it.