Hi,
I get a problem when I call a function in a movie clip.
I place a movie clip named “aMC” in the first frame of the root timeline. Inside the movie clip, there is a function call testFunc(). I add some action script in the first frame of the root timeline.
That action script is:
_root.aMC.testFunc();
I suppose it can call the function inside the movie clip, but I fail to do this. I also try to place a button in the first frame of root timeline and add the code in the button:
on(release)
{
_root.aMC.testFunc();
}
It can call the funtion successfully.
Someone may ask this question before, but I really confuse about this. Hope someone can help me.
the problem with your function, I believe, is that you’re calling the function before the movie declares it. Know what I mean? Also, you’re not pointing to the function inside the movie. So, for example, if you had three movies with the same function defined… which movie would you be calling?
I agree Iammontoya said that I called the function before the movie declares. Then, is there any method or trick, so that I can call this kind of function inside a movie clip?
Creating engaging and entertaining content for designers and developers since 1998.