Reputation: 13527
Ok, so this might seem like a stupid question, please try and see my predicament (at least that's what I tell myself):
I have a flash, which loads button with Actionscript 2.0. Now, my swf is no longer than 1 frame, and in my Actionscript, I refer a lot to _root.
Is there a way I can preload my movie without interfering with the _root references. Because I tried doing an onEnterFrame trace of the movie like this:
_root.onEnterFrame = function() {
trace(this.getBytesLoaded());
}
But this does not trace anything until the movie is loaded completely.
Any help would be much appreciated.
Upvotes: 0
Views: 323
Reputation: 1135
The easiest way to do, is to split your flash into two frames.
onClipEvent(enterFrame){ if (_root.getBytesLoaded() >= _root.getBytesTotal()){ gotoAndStop(2); }
This technique has saved me from the same trouble many times before. Good luck.
Upvotes: 1
Reputation: 1152
I would suggest checking out the _lockroot function.
It can be found documented in the Flash help here:
Learning Actionscript 2.0 in Adobe Flash -> Best Practices and Coding Conventions for ActionScript 2.0 -> ActionScript coding conventions -> Handling scope -> Using _lockroot I hope this helps
Upvotes: 1