4 Replies Latest reply on Jul 2, 2006 11:00 PM by kglad

    mc button to play another mc

      Hi all,

      I'm here due to the lack of assistance at Flashkit. I have a mc button in a movie clip, that i want to, when rollOver, play another movieClip within the current movieclip. I've only gotten it to partially work. At one point i got it to work when testing the scene, but when testing whole movie, it didn't work.

      Does the clip I want to play on rollover need to be in the same frame/layer as the button. I've tried it both ways, I'm sure my Actionscript is all hackneyed. I'd post code but it's not working anymore.

      http://s63.photobucket.com/albums/h139/typophile/?action=view&current=SITE.swf&refPage=&im gAnch=imgAnch1

      click on white box to skip intro, then click WORK. When the menu comes up if you roll over one of the image icons, I'd like another Movieclip to play that says what it is.

      Thanks in advance.


      I got this to work, ONLY when testing that particular clip. I guess my targeting is off somehow. I just can't figure it out.

        • 1. Re: mc button to play another mc
          kglad Adobe Community Professional & MVP
          there is no movieclip method play() that accepts a parameter (like a frame label or a frame number). use _root.Dammit.gotoAndPlay("frame label 2") or _root.Dammit.gotoAndPlay(2);
          • 2. Re: mc button to play another mc
            Craig Grummitt Level 3
            yes if you're trying to tell a movieclip to do something whether that's to go to a frame or play or whatever, then it needs to exist in the same frame. it can be in a different layer, that's fine, but it the actionscript or button talking to the movieclip is on frame 15 then the movieclip must exist on frame 15.

            targeting issues are common so its quite likely that you'll need to check that you're targeting the movieclip correctly also.

            the code you posted has two additional issues. the play method doesn't accept parameters. to go to specific frames you'll need to use the gotoAndPlay method. And if the numbers you've used as parameters are intended as frame numbers, you'll want to remove the quotation marks. Only frame labels use quotation marks.
            • 3. Re: mc button to play another mc
              Svedish_PIRATE Level 1
              Craig and Kglad,

              Thanks for clearing up my syntax. I figured it out. In my targeting issue, I was targeting the movie clip name and not an instance name (which i hadn't given). Probably a good idea to get in the habit of naming all instances.

              Thanks again guys *I'm assuming,

              • 4. Re: mc button to play another mc
                kglad Adobe Community Professional & MVP
                you're welcome. (and correct).