5 Replies Latest reply: Jul 7, 2009 2:29 AM by har678 RSS

    GotoandPlay???

    CarlBe1 Community Member

      Hi

       

      I am new to Action Script 3.

       

      I have set up a pretty basic standard script for a button menu to go to a particular page;

       

      It works just fine - however instead of "goingtoandSTOPPING" - I want it to go to and PLAY a particular page (a scene with a tween) - my logic was to replace gotoAndStop with gotoAndPlay - and then place a stop(); at the end of that particular scene - however it doesn´t want to work and accept a stop command.

       

      Can anyone advise me what I can do?

       

      Thank you

       

      Carl

        • 1. Re: Maybe the solution
          har678 Community Member

          Ok. I see your problem. I am a new Adobe Flash User and dont know much, but I have figured out, that if you have a layer named "Background", or something like that, and it is not a Tween Motion, and has no script in it, just place a "stop();" at the start of the scripting dialog. Also, to make the tween work, you must place this on the button that goes to that certain scene: (We will use "doClickButton21" as an example.)

           

          myButtonName.addEventListener(MouseEvent.CLICK,doClickButton);

           

          function doClickButton21(e:MouseEvent):void {

               trace:("clicked");gotoAndPlay(1,"SceneName");gotoAndPlay(1, "LayerName");

          }

           

          Hopefully this helped. If you dont understand, just say so here and I will try and make it more simple.

          • 2. Re: GotoandPlay???
            Ned Murphy CommunityMVP

            Can you explain what you mean when you say it cannot accept a stop command?  If you mean it doesn't stop despite having a stop(); command, then chances are some other code in the scene is telling it to continue.

            • 3. Re: Maybe the solution
              kglad CommunityMVP

              i believe you're trying to be helpful, har.  but, you should wait until you're more familiar with flash/actionscript before giving advice.

              • 4. Re: GotoandPlay???
                CarlBe1 Community Member

                Hi

                 

                I think that I have managed to crack the code!!

                 

                So I will close this for the moment - many thanks for taking the time to look at it.

                 

                Carl

                • 5. Re: Maybe the solution
                  har678 Community Member

                  Sorry about the false info before. I ahve been working 2 days on this, so I should be right by now. Watch the preview movie that I made. It will hopefully solve your problem. If this is wrong, I apologize... again.

                   

                  Sorry in advance if incorrect. LOL

                   

                  Edit: It wont allow the movie, so I just uploaded the ZIP file which contains all the files.