简体   繁体   中英

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. 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");
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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