Skip to main content
Participant
September 13, 2009
Question

cant get mc to play on root

  • September 13, 2009
  • 2 replies
  • 277 views

Hello,

I  need some help.

I have a movie mc that contains buttons called menuMovie. I also have another movie clip called "myMovie". There is an instance of menuMovie on the main timeline in keyframe1 called "_menuMovie_mc".  There is also an instance of myMovie on keyframe1 called "_myMovie_mc" .  I want to have one of the buttons in menuMovie play myMovie.mc which has a label called _here". My understanding is:

root._myMovie_mc.gotoAndStop("_here");

Thank you,

-David

This topic has been closed for replies.

2 replies

Ned Murphy
Legend
September 13, 2009

If your intention is to play the mc from the frame labeled "_here", then you might need to be using gotoAndPlay instead of gotoAndStop.

Also, when you are referencing the root, you often need to reference it as a MovieClip...

MovieClip(this.root)._myMovie_mc.gotoAndStop("_here");

You also might consider coding your menu buttons from the main timeline, targeting them thru the menu mc.  That will save you from having to use root references in your code... meaning, in the main timeline...

_menuMovie_mc.btnName.addEventListener(MouseEvent.CLICK, btnHandler);

function btnHandler(evt:MouseEvent):void {

     _myMovie_mc.gotoAndStop("_here");

}

Inspiring
September 13, 2009

What is the question?