PDA

View Full Version : Call a function in an externally loaded SWF?



kiliaan856
January 7th, 2005, 10:13 PM
is it possible to call a function in an externally loaded swf from _level0 ?


Sceneraio

I have "mySwf" with "myFunction" in it.

I have "myMovie" which loads "mySwf"

can I call

this.mySwf.myFunction();

It dosn't seem to work for me... lemme know if im missing something.. thanks!

SmoothDime
January 7th, 2005, 10:40 PM
how do you define your function in the external SWF?

it should be like this:


//on root
this.myFunction = function()
{
trace("it works");
};


not like this:


function myFunction()
{
trace("it does'nt work");
}

kiliaan856
January 8th, 2005, 02:55 AM
right... it is defined like your first example... maybe im missing something simple here... will doublecheck

scotty
January 8th, 2005, 05:57 AM
Are you loading in levels or in a (empty) mc?

scotty(-: