简体   繁体   English

ActionScript 3.0中动画片段中的按钮

[英]button within movieclip in actionscript 3.0

I have a button inside a movieclip that I want to navigate to another movieclip in the main timeline 我在动画片段中有一个按钮,想要导航到主时间轴中的另一个动画片段

i used this code, but the button doesnt do anything: 我使用了这段代码,但是按钮没有做任何事情:

btnHome.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3);

function fl_MouseClickHandler_3(event:MouseEvent):void
{
    MovieClip(this.parent).gotoAndStop("Menu");
}

how do you navigate to the main timeline within a movieclip? 如何导航到动画片段中的主要时间轴?

The code is fine. 代码很好。 If you are using that code as it is, make sure it's inside the btnHome parent movieclip. 如果按原样使用该代码,请确保该代码位于btnHome父movieclip中。 That code Will not work if it's on the main timeline or elsewhere. 如果该代码位于主时间轴或其他地方,则该代码将不起作用。

btnHome.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3);    
function fl_MouseClickHandler_3(event:MouseEvent):void{
    MovieClip(this.parent).gotoAndStop("Menu");
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM