开发者

AS2 call function inside movieclip

开发者 https://www.devze.com 2023-04-08 02:16 出处:网络
I have a movieClip with a few animations and a layer for actionscript code. What I need to do is to call a function that is defined in MovieClip from \"Scene 1\".

I have a movieClip with a few animations and a layer for actionscript code. What I need to do is to call a function that is defined in MovieClip from "Scene 1".

I've tried many combination without success: _root.mc1.teste(); mc1.teste();开发者_StackOverflow社区 this.mc1.teste(); parent.mc1.teste();

At this moment, movie clip is located on "Stage 1" and it has instance name "mc1". I also have tried to create the same movie clip dynamicly with "attachMovie" but the problem remains.

I don't know what I'm doing wrong.

EDIT As you can see on the image below. I have some functions defined in Layer3 on a frame1 and I want to call them from Scene1).

AS2 call function inside movieclip

Any help is appreciated.


Are both your clips on stage?

Debugging Tip: Try to trace each clip so you know that you are targeting them correctly.

// Inside each clip, trace it's own path
trace(this);

This way, you can discover the actual path that needs to be used.

0

精彩评论

暂无评论...
验证码 换一张
取 消