1
我想從動畫片段「B」控制動畫片段「A」組件。可能從另一個影片剪輯控制movieclip組件?
影片剪輯答:
function click1(event:MouseEvent):void
{
// I want to change text of button which is inside movieclip "B" in here.
}
btn1.addEventListener(MouseEvent.CLICK , click1);
影片剪輯B:
function click2(event:MouseEvent):void
{
//and here I want to change text of button which is inside movieclip "A".
}
btn2.addEventListener(MouseEvent.CLICK , click2);
我該怎麼辦呢?
對不起,我的英語。
如果您在2個影片剪輯的父級中聲明您的代碼,您可以將範圍只聲明爲'mca.someButtonObject.label = ...'而不包括'stage' – ToddBFisher 2011-12-26 16:17:07
@TdBdBFisher感謝您指出出更一般的情況。理論上講,使用一個共同的祖先(父母等通常最接近的)。 – iND 2011-12-26 16:42:48