6 Replies Latest reply on Aug 2, 2006 9:41 PM by Newsgroup_User

    Making gotoAndPlay Global?

    blockmir
      Hi,
      I'm working on a simulator that has the main timeline filled with different screens to goto. I'm working with some popup menus that I want to contain in a movie clip. When something form the popup menu is selected, I would like it to goto a location on the main timeline. Does anyone have any ideas of how this can be done?

      Thank you for your suggestions :-)
        • 1. Re: Making gotoAndPlay Global?
          blockmir Level 1
          Hi Again,
          Thx for the help it seems that this can be done with _root.gotoAndPlay(1).
          It appears that I was putting the _root on the wrong side of gotoAndPlay.

          Thanks again.
          • 2. Re: Making gotoAndPlay Global?
            Level 7
            blockmir,

            > Thx for the help it seems that this can be done with
            > _root.gotoAndPlay(1). It appears that I was putting
            > the _root on the wrong side of gotoAndPlay.

            Some people will go so far as to say _root is "evil". I'm not one of
            those people, but it is important that you realize _root may not always mean
            what you think it means.

            This may help a bit ...
            http://www.quip.net/blog/2006/flash/actionscript-20/is-root-evil


            David
            stiller (at) quip (dot) net
            Dev essays: http://www.quip.net/blog/
            "Luck is the residue of good design."


            • 3. Re: Making gotoAndPlay Global?
              blockmir Level 1
              David, thank you kindly for your reply,
              I also find your blog to be loaded with tons of information (probably too much for me to digest at my beginning point with Flash). However, I have yet to figure out how to apply it towards my project of doing a menu which is a MC that has a submenu_mc and a submenu2_mc.
              I have a main timeline that makes the first menu visible and then from there, you click a button that goes to a label with a keyfram that shows the submenu_mc.

              The part I don't quite understand yet is that I can test just the submenus by themselves and they work great, but when I try to play the complete movie it doesn't work. I click on the menu button and the main menu shows up. Then I click the button that is supposed to go to the keyframe that shows the submenu, but nothing happens when I click on the button. I think it has something to do with path so I have read your articles about actionscript trying to figure it out but to no avail.

              I put in a trace(this); and it claims that it is level0 when I play the movie. I have tried root. level0. this. and can't quite figure it out.

              Would you be willing to help me figure this out as I have been trying Since Sunday getting nowhere but frustrated?

              Thank you kindly in advance for helping me the first time and for the articles that you post.
              • 4. Re: Making gotoAndPlay Global?
                Level 7
                blockmir,

                > Then I click the button that is supposed to go to
                > the keyframe that shows the submenu, but nothing
                > happens when I click on the button.

                Oh, something is definitely happening! *Something* is, but you'll have
                to figure out what. ;)

                > I think it has something to do with path so I have
                > read your articles about actionscript trying to figure
                > it out but to no avail.

                Unfortunately, based on your description so far, I can't really "see"
                what your project entails. The devil is in the details, they say. ;)

                > I put in a trace(this); and it claims that it is level0
                > when I play the movie.

                Where did you put this trace() function?

                > I have tried root. level0. this. and can't quite figure
                > it out.

                I hear ya. ;) Keep your chin up. I can only stab in the dark, though,
                because I have no idea what's going on in your FLA.

                > Would you be willing to help me figure this out as
                > I have been trying Since Sunday getting nowhere
                > but frustrated?

                We can keep duking it out here. :) It's going to take slow steps with
                pertinent detail. Off the top of my head, it sounds like you just need to
                *see* what's going on under the hood. Check out this debugging article,
                which may help you considerably.

                http://www.adobe.com/devnet/flash/articles/debugging_actionscript.html


                David Stiller
                Adobe Community Expert
                Dev blog, http://www.quip.net/blog/
                "Luck is the residue of good design."


                • 5. Re: Making gotoAndPlay Global?
                  blockmir Level 1
                  Hi Again. I finally found it after about 5 hours of going through everything. It had nothing to do with the actionscript at all. I noticed that the main timeline for some reason for somereason was processing the code around the part that told it to go to the Labelled Frame on the MC but not but not the part of gotoAndPlay at all. It turns out that while the libray and I thought it was a movie clip, the property inspector was showing that the MC was to be treated like a button. As soon as I changed it to match as being an MC, the script worked flawlessly.

                  The sad part to say is that although i tried and tried to figure out how to use debugger, I haven't got the hang of it yet.

                  David once again thank you very kindly for your help and please keep writing articles that take information from the help in Flash and explaining it to the rest of us in English. Hopefully I will be able to go farther this next round without having to bug you.

                  Thanks again,
                  Neil
                  • 6. Re: Making gotoAndPlay Global?
                    Level 7
                    Neil,

                    > ... I thought it was a movie clip, the property inspector
                    > was showing that the MC was to be treated like a
                    > button.

                    Oh, wow. Good catch!

                    > As soon as I changed it to match as being an MC, the
                    > script worked flawlessly.

                    Good for you, Neil. :)

                    > The sad part to say is that although i tried and tried to
                    > figure out how to use debugger, I haven't got the hang
                    > of it yet.

                    Well, by the sound of it, the Debugger may not have helped in this case,
                    after all, since -- as you discovered -- the problem wasn't ActionScript
                    related. Really, man, I'm glad you nailed it.

                    > David once again thank you very kindly for your help
                    > and please keep writing articles that take information
                    > from the help in Flash and explaining it to the rest of
                    > us in English.

                    Ha! Thanks. :) Actually, the documentation has been very, very good
                    in Flash for a number of versions now. It'll gel for you ... just keep at
                    it. It really does make sense when the concepts start popping into place.

                    > Hopefully I will be able to go farther this next round
                    > without having to bug you.

                    You're not bugging me at all.


                    David Stiller
                    Adobe Community Expert
                    Dev blog, http://www.quip.net/blog/
                    "Luck is the residue of good design."