Hi all,
I have main movie A that loads (with a Loader) another movie B inside. In movie A I have a class API, with a bunch of static methods that perform actions in A.
A.as
public class Main extends MovieClip{
public Main()
{
b= new Loader();
b.load("b.swf");
addChild(b);
}
}
-------
API.as
public class API{
public static function DO_STUFF() { ... }
}
-------
B.fla
API.DO_STUFF();
The fact is that I cannot do this last call, because API class is not available at compile time (but it is on run time).. Could I delay this check to run time? How could I expose API to loaded movies (done by clients)?
I found I can make a interface/bridge function in A, like this:
public function DO_STUFF() { API.DO_STUFF(); }
and then call this from B:
MovieClip(parent.parent).DO_STUFF();
but it seems to be very ugly and unadequated to me.. I'd rather prefer an API.do_stuff() type of call.
any solution? Thanks!