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());
nolockroot_mc._lockroot = true;
nolockroot_mc.loadMovie("nolockroot.swf");
which would then trace the following:
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
myOtherVar -> 2
myVar -> 1
594
Chapter 7: ActionScript for Flash
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
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?