-
preload breaks _lockroot?
I have a game that gets loaded into an interface shell. On the first frame of my game I have this._lockroot = true.
So far in developmet this has been working perfectly. But now an issue has come up.
In the loader of the shell, an empty movieclip is created to preload the game (and the shell). When the game is finished loading, the movieclip created for the preload is destroyed (removeMovieClip) and the shell continues and does some other stuff and then the game is loaded later on into another preplaced movieclip.
Now the game's _lockroot doesn't work.
I have tried many things when destroying the preloaded clip (removeMovieClip, unloadMovie, delete, etc.) and still it doesn't work. Comment out the preloader for the game and everything works fine.
What's going on?
brad
-
did you use loadMovieNum or loadMovie on the movie clip ya removed? first guess is that the lockroot is in the timeline of the movieclip you removed, or you used loadMovieNum and targetted that level on accident.
-
Definitly not loadMovieNum, I can see the game loading into the correct clip off stage.
first guess is that the lockroot is in the timeline of the movieclip you removed
So... does this mean only one movieclip can have _lockroot? The lockroot command is in my actualy game. If this is the case how can I clear the preload MC's ownership of the only lockroot? I have tried:
_root.gamePreLoad_mc._lockroot=false;
and
_root.gamePreLoad_mc.unloadMovie();
and
_root.gamePreLoad_mc.removeMovieClip();
and
_root.createEmptyMovieClip("gamePreLoad_mc", 5); //overwrite original
and every combination/permutation of the above.
before I remove the clip. I have also tried only setting _lockroot=true in my game if the _parent movie is not in a preload state.
I just can't get this to work.
-
aha! i think i see your problem
you're trying to call lockroot from the main swf and targetting the loaded swfs... maybe this works (but it's not looking like that's the case, i certainly have never seen it that way)... anyhow, in each swf that you want _lockroot to be set on, put in the first frame
Code:
this._lockroot = true;
-
you're trying to call lockroot from the main swf and targetting the loaded swfs... anyhow, in each swf that you want _lockroot to be set on, put in the first frame
I am setting _lockroot on the first frame of my game that gets loaded in, not from the main swf. So I am already doing what you are suggesting.
I have tried setting the _lockroot many different ways (from the loader swf, from the loader swf on the target mc, etc.) and nothing is working.
brad
-
Issue Resolved.
In my game.swf I have an imported class.(I moved my import statement around apparently it makes no difference whre it is.)
import Game;
though my Game is not instantiated yet, this was causing the issue.
So after preloading the game in the loader movie:
delete Game; //this fixed it
gamePreLoad_mc.unloadMovie();
gamePreLoad_mc.removeMovieClip();
So yeah, there you go anyone else who runs into this issue.
brad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|