I’ve tried looking everywhere for this answer, but I’m still at a loss. I’m beginning to think it’s not possible or I’m just not looking in the right places.
I have three swf files. The main container and then two external swf files being loaded into the main swf. Swf 1 (frame.swf) has a function on the main timeline that needs to be called from a button in swf 2 (toolbox.swf). My initial thought was to place the actionscript of frame.swf into a movieclip and call it from toolbox.swf using:
_root.callFunction(“PH”, “doPhone”);
Although this would work, I cannot use this option. The actionscript of *swf 1 *must stay in the main timeline. Using a class file is not an option either. Is there any other way to call a function from the main timeline of an external swf?
var mc1:MovieClip=_root.createEmptyMovieClip(“target”,0);// swf with the function
loadMovie(“a.swf”,mc1);
var mc2:MovieClip=_root.createEmptyMovieClip(“btn”,1);// swf with the button
loadMovie(“b.swf”,mc2);
onEnterFrame=function()
{
if((mc2.getBytesLoaded()>=mc2.getBytesTotal())&&(mc2.getBytesTotal()>0))
{
if((mc1.getBytesLoaded()>=mc1.getBytesTotal())&&(mc1.getBytesTotal()>0))
{
delete this.onEnterFrame;
mc2.btn.onPress=function()
{
mc1.colorMe(); // call your function
}
}
}
}
[quote=kaylee;2325117]I’ve tried looking everywhere for this answer, but I’m still at a loss. I’m beginning to think it’s not possible or I’m just not looking in the right places.
I have three swf files. The main container and then two external swf files being loaded into the main swf. Swf 1 (frame.swf) has a function on the main timeline that needs to be called from a button in swf 2 (toolbox.swf). My initial thought was to place the actionscript of frame.swf into a movieclip and call it from toolbox.swf using:
_root.callFunction(“PH”, “doPhone”);
Although this would work, I cannot use this option. The actionscript of *swf 1 *must stay in the main timeline. Using a class file is not an option either. Is there any other way to call a function from the main timeline of an external swf?[/quote]