Quantcast
Channel: Adobe Community : All Content - Adobe Animate CC - General
Viewing all articles
Browse latest Browse all 13519

Link a button inside a movie clip to a scene

$
0
0

I am trying to link a button that is inside a movie clip to a scene. The button has the instance name "cosmetic_btn" and the scene is called "Cosmetic Treatments".

 

On my main timeline I have the code:

 

cosmetic_btn.addEventListener(MouseEvent.CLICK, clickHandler);

function clickHandler(evt:MouseEvent):void {

gotoAndStop(1, "Cosmetic Treatments");

}

 

And on the timeline inside the movie clip I have this code:

 

MovieClip(root).gotoAndStop("Cosmetic Treatments");

 

When I run the document I get the following error:

 

Home, Layer 'actions', Frame 101, Line 11120: Access of undefined property cosmetic_btn.

 

I have the instance name "cosmetic_btn" set on the button so I am unsure what is wrong here?

 


http://img600.imageshack.us/img600/3236/gp2g.png


Viewing all articles
Browse latest Browse all 13519

Trending Articles