This content has been marked as final. Show 3 replies
Load function enables you to load an swf inside a MovieClip (you choose its
name). Then simply by typing the name you chose followed by a plot and the
function's name or object you want to access, you just tells the player to
execute that function or read/write the variable's value.
Just as in:
myclip.myVar= "This is the clip's variable content";
myclip.myfunction("hi", "that's all");
I hope it helps.
"jpwrunyan" <firstname.lastname@example.org> escribi� en el mensaje
>I posted a similar question in the General Discussion but, when I load an
>SWF with the Loader class, how do I access variables and methods on that
>SWF? Is it possible?
var externalSWF:MovieClip = _loader.content; // or _loader.getChildAt(0);
if it's an external swf and you don't know the type, you can either have the external swf extend a package within your calling swf, or use:
var fn:Function = externalSWF['somefunctionname'];
fn.apply(externalSWF, [param1, param2])
I originally thought that I should be able to access the functions like you showed but was getting an error. At least I know the error wasn't from the code written on the side actually loading the .swf.