What's the best way to pass a predefined argument to flash?
A:
Pass it as name-value pairs in the SWF's URL.
"mymovie.swf?defColor=blue&stage=3"
and read it from the loaderInfo.parameters property of the root
movie clip - the one with the document class.
var params:Object = root.loaderInfo.parameters;
//or this.loaderInfo.parameters if you're calling from the document class.
trace(params.defColor); // dot sytax and
trace(params["stage"]); // [] syntax works.
Amarghosh
2010-07-13 06:07:30
Is `root` available in as2 ?
wamp
2010-07-13 07:11:58
@wamp `root` is `_root` in AS2, but that's a little different from the AS3 root concept I believe. I am not sure if it has `loaderInfo` property either.
Amarghosh
2010-07-13 07:54:49
@Amarghosh,I just verified that it's not available in `as2`
wamp
2010-07-14 05:12:11