3 Replies Latest reply on Oct 4, 2009 5:49 AM by Ned Murphy

    Beginner needs help with gotoAndPlay syntax


      Hello out there.


      I am modifying a Flash template which I downloaded recently


      The following code has been placed on a symbol which is defined as a button.


      on (release) {

      _root.link = 3;

      _root.gates.gotoAndPlay ("s1");



      I interpret this code to mean that _root.gates is the instance name which is located in the root timeline and it will move the play head to the frame labeled s1 in the gates instance which I assume is a movie clip.


      How do I locate the gates instance in the flash file. I have looked at every symbol in the entire flash file and none of them have instance names.


      Please help if you can. Thanks

        • 1. Re: Beginner needs help with gotoAndPlay syntax
          Ned Murphy Adobe Community Professional & MVP

          Your interpretation of that code seems fine.  Based on the gates instance having a frame label, it makes more sense that it is indeed a movieclip, though it does not necessarily need to be on the stage.  It could be a library object that is dynamically added to the stage.  It is also possible that it could be a separate swf file that gets loaded into a dynamically created movieclip with the name "gates".


          But in case you aren't sure of what an instance name is, it is a name that is often assigned to an object (movieclip, button, textfield, component) that you manually place on the stage.  The instance name in that case is assigned in the Properties Panel, so what you might need to do is select each object on the stage individually and check the Properties Panel to see what instance name is assigned (if any).


          If it happems to be a dynamically created/loaded item, then you will find that activity in the actionscript code somewhere.

          1 person found this helpful
          • 2. Re: Beginner needs help with gotoAndPlay syntax
            JW-WebMan Level 1

            OK. When I test the entire flash movie and click on the referenced button, it plays the referenced movie clip. The movie clip it plays looks identical to a symbol in the library which is named "symbol 55 copy  3" in the library. This is where I was expecting to see the "gates" instance name in the properties panel but is does not have an instance name.This leads me to believe that it is not coming from a seperate swf file.


            I hope this helps to clarify a little.

            • 3. Re: Beginner needs help with gotoAndPlay syntax
              Ned Murphy Adobe Community Professional & MVP

              You've probably narrowed it down to being an object from the library.  Now you need to see if it is either on the stage or is loaded dynamically.


              If you right click on the object in the library and select Linkage..., you'll be able to see if it might be loaded dynamically.  In order to load it dynamically, in the Liinkage panel it will need to have the Export for Actionscript option checked (and one other) and will have an Identifier defined for it.  This identifier is what will be used to pull it from the library via actionscript (using the attachMovie method).


              If it doesn't have things in the Linkage established as I've described, then it likely lives on the stage.  If you are unable to find it, then it may be on a masked layer, or it may be set invisible on the timeline, or it may have a blank first frame which would make it appear as a mere dot on the stage if selected.


              Now, regardless of whether you find how it's added to the stage, if your intention is to edit this object in some way, You don't necessarily have to figure out the details of how its added to the stage.  To check if the object in the library is the one you want to edit, edit it in some simple way so that you can tell if the item you edit is the item you want edited.  If it is, then do the editing you intend.