This content has been marked as final. Show 4 replies
I have not been able to figure out this scoping problem. Is there anyone out there that can help me or at least point me in the right direction?
"I have a movie that is just a preloader for the main movie. This preloader movie has the loader and progress bar components so that I can show the process of the main movie loading. "
Yes, that's what I am doing too, and I had a problem when an important button in the main movie no longer working properly.
I found an answer to this issue in another thread. In the large (external) file that your preloader is loading, place this in the first frame:
That solved the problem for me.
Thank you, I will try this tomorrow.
Putting the following code on frame one in the movie being loaded by the preloader corrected the problem.
The following is what Flash 8 help file says about _lockroot
_lockroot (MovieClip._lockroot property)
public _lockroot : Boolean
A Boolean value that specifies what _root refers to when a SWF file is loaded into a movie clip. The _lockroot property is undefined by default. You can set this property within the SWF file that is being loaded or in the handler that is loading the movie clip.
For example, suppose you have a document called Games.fla that lets a user choose a game to play, and loads the game (for example, Chess.swf) into the game_mc movie clip. Make sure that, after being loaded into Games.swf, any use of _root in Chess.swf refers to _root in Chess.swf (not _root in Games.swf). If you have access to Chess.fla and publish it to Flash Player 7 or later, you can add this statement to Chess.fla on the main Timeline:
this._lockroot = true;
If you don't have access to Chess.fla (for example, if you are loading Chess.swf from someone else's site into chess_mc), you can set the Chess.swf _lockroot property when you load it. Place the following ActionScript on the main Timeline of Games.fla:
chess_mc._lockroot = true;
In this case, Chess.swf can be published for any version of Flash Player, as long as Games.swf is published for Flash Player 7 or later.
When calling loadMovie(), set the MovieClip._lockroot property to true in the loader movie, as the following code shows. If you don't set _lockroot to true in the loader movie, any references to _root in the loaded movie point to the _root of the loader instead of the _root of the loaded movie:
myMovieClip._lockroot = true;
Availability: ActionScript 1.0; Flash Player 7