开发者

AS2 - Accessing movieclip properties from inside another movieclip

I have 2 movieclips. One is a fairy flying up the stage. The other movieclip is a magic dust, which is originally designed to generate magic dust with onMouseMove event, based on the mouse's x & y. I want to change the the magic dust movieclip so it will generate magic dust following the fairy's movement.

this.onMouseMove =开发者_如何学C function() { generator(this._xmouse,this._ymouse,5); generator(this._xmouse,this._ymouse,10); };

1) What event do I use in the magic dust movieclip? onEnterFrame? 2) How do I access the fairy's x & y info?

Thanks.


There's many options. You can update dust every frame with faerie coords from code, or give the dust reference to the faerie.


Give the fairy an instance name "fairy" and instead of

this._xmouse/this._ymouse 

use

_parent.fairy._x / _parent.fairy._y
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜