-
_lockroot
Hello
I am curious as if anyone knows anything about the _lockroot script
I am working on this SWF project of coarse. It loads a External SWF into another. The main SWF is called Transmit. It loads a SWF titled Transimssion. In the Transmission SWF i have a news MC that is loaded as invisible when you click the News Button is sets it Visible. You click Close it sets it Invisible. Now everything works great, when i play Transmission without loading it into Transmit. I load it into Transmit, it doesn't set itself invisible when loaded, it does not Drag, clicking the News button doesn't make it visible, cna clicking close does not set it invisible. I have in Transmit. on the Empty MC that loads Transmission. The following code:
{
this._lockroot = true;
}
load_position.loadMovie ("transmission.swf");
This should make the code in Transimssion, when loaded into Transmit work but does not. Anyone have any ideas? Thanks alot.
-
Senior Member
I don't quite follow what you've done, you can add the line
this._lockroot = true; // requires flash player 7
to the first frame of the movie that gets loaded into the movie clip, to make actions within this movie that use _root to target the main timeline behave in the same as if the movie were running on its own.
-
No, i already attempted that. Just for **** and giggles, does not work, thanks for thought htough. Kinda confusing why that is not working when i load the Second SWF into the first, but the second SWF is played alone it's great. No idea. . .
-
Senior Member
Would you be able to post the files anywhere to check?
-
The files are pretty big . . . if your wanting to look at the code. If you want to just see the SWF, i do not have them published to the web yet, but i can do . . . basicly as i understand the _lockroot. should keep, if placed inside the first SWF all _root. commands inside the second SWF from having to do anything inside the first. And vise versa, as i understand? So i think, this might be a glitch corrected with the patch coming out this month? Is there another way to do this? Cause by itself the second works perfectly but loaded into the second nothing works . . . thanks. I have it inside the first frame, i the first SWF, maybe it should go inside the Second SWF?
Thanks
-
Senior Member
this._lockroot = true;
should be inside the second movie (the one that gets loaded into the movie clip)
-
In the first frame? Still does not work . . i have no idea.
Is there any other way to fix this issue? Another script i could be unaware of, that does the same thing?
Last edited by Thealiengus; 11-05-2003 at 08:46 PM.
-
Senior Member
In previous versions you could create a similar effect to _lockroot by using the following in the first frame of the movie that is loaded into the movie clip,
_global.myMovie_tl = this; // for MX
or
Object.prototype.myMovie_tl = this; // for flash 5
this creates a variable named myMovie_tl which contains a reference to the main timeline of the movie (where _root would have targeted before the movie was loaded into a clip) this variable is global and hence is available anywhere within the movie, so you can then replace all the usage of _root in the movie with myMovie_tl, eg
_root.myClip.gotoAndPlay(2);
would become,
myMovie_tl.myClip.gotoAndPlay(2);
etc.
-
Yeah, that just makes it not work weither loaded into the first SWF or on it's own. Makes the issue worse . . . (Maybe it's a glitch in the Matrix? Yeah i saw Revolutions today . . . sorry ) Need to make fun of myself once in a while.
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
|