Help, please, with a Deeply nested FECCallfunction

Posted by BruceND75 
Help, please, with a Deeply nested FECCallfunction
August 25, 2009 07:55AM
I have a loaded external SWF that I would like to receive a function call from. To help understand, let's call them parentSWF and childSWF.

In the childSWF, the MovieClip that I would like to make a FlashEff button out of is located a couple of MovieClips deep. In other words, I have:

1: the childSWF scene
......2: MovieClip #1
............3: MovieClip #2
..................4. theMovieClipThatIWantToMakeAFEButtonOf

My ultimate goal is to have the childSWF:

1 - First, determine if it is loaded in the parentSWF.
2 - If it is Not loaded in the parentSWF, I want it to just ignore a call from the FlashEff button.
3 - If it Is loaded in the parentSWF, I want the childSWF to call a parentSWF function, and pass along a parameter in doing so.

I created the following code on the first frame of the childSWF:

function goBack(theParam:int):void
{
	if (MovieClip(parent)!=null)
	{
		MovieClip(parent).parentFunction(theParam);
	}	
}

Then, in the FlashEff button down in the childSWF, I was planning on doing a FECCallFunction with 'goBack' in the function spot and 0 in the parameter spot.

Well, something up there is not right, and no matter what combination I try, I get errors like:

"FLASHEFF Warning : Invalid function definition was setted in functionPath parameters of FECCallFunction object. TypeError: Error #1010: A term is undefined and has no properties."

I believe I need to be dealing with parents inside of parents of some sort, but I can't piece it all together.

Help!
Re: Help, please, with a Deeply nested FECCallfunction
August 25, 2009 08:37AM
I've made a small example for you. I think it's pretty self-explanatory.
Here is the link to the file.
Please use the FlashEff2 panel to look at the way I did called the function (go to the component and open the panel and look under Button\Command).
Hope this helps.

PS. if you have your timeline on the root you can also use root.gotoAndPlay() instead of parent.parent.parent.gotoAndPlay()

-Ionut



Edited 2 time(s). Last edit at 08/25/2009 10:43AM by Ionut.
Re: Help, please, with a Deeply nested FECCallfunction
August 26, 2009 04:31AM
Ionut,

Thanks! That worked great!
Sorry, you do not have permission to post/reply in this forum.