MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference page 544

Actionscript language reference
Table of Contents

Advertisement

_lockroot -> true
$version -> WIN 7,0,19,0
The following example loads two SWF files, lockroot.swf and nolockroot.swf. The lockroot.fla
document contains the previous ActionScript. The nolockroot FLA file has the following code
placed on Frame 1 of the Timeline:
_root.myVar = 1;
_root.myOtherVar = 2;
trace("from nolockroot.swf");
for (i in _root) {
trace("
"+i+" -> "+_root[i]);
}
trace("");
The lockroot.swf file has _
loaded, each file dumps variables from their
the main Timeline of a FLA document:
this.createEmptyMovieClip("lockroot_mc", this.getNextHighestDepth());
lockroot_mc.loadMovie("lockroot.swf");
this.createEmptyMovieClip("nolockroot_mc", this.getNextHighestDepth());
nolockroot_mc.loadMovie("nolockroot.swf");
function dumpRoot() {
trace("from current SWF file");
for (i in _root) {
trace("
}
trace("");
}
dumpRoot();
which traces the following information:
from current SWF file
dumpRoot -> [type Function]
$version -> WIN 7,0,19,0
nolockroot_mc -> _level0.nolockroot_mc
lockroot_mc -> _level0.lockroot_mc
from nolockroot.swf
myVar -> 1
i -> lockroot_mc
dumpRoot -> [type Function]
$version -> WIN 7,0,19,0
nolockroot_mc -> _level0.nolockroot_mc
lockroot_mc -> _level0.lockroot_mc
from lockroot.swf
myOtherVar -> 2
myVar -> 1
The file with no
as well. If you don't have access to the nolockroot.fla, then you can change the
main FLA document above using the following ActionScript added to the main Timeline:
this.createEmptyMovieClip("nolockroot_mc", this.getNextHighestDepth());
544
Chapter 2: ActionScript Language Reference
applied to it, and nolockroot.swf does not. After the files are
lockroot
"+i+" -> "+_root[i]);
applied contains all of the other variables contained in the root SWF
_lockroot
scopes. Place the following ActionScript on
_root
in the
_lockroot

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents