13 Replies Latest reply on Apr 7, 2007 9:02 PM by Sketchsta

    controlling a movie clip timeline

    Opera Rat Level 1
      I am using a loaded movie clip in my movie. This script is on a button:

      loadMovie("largeWorks_mc.swf",_root.largeWorksE_mc);

      Why can''t I control this loaded movie clip from a button in another movie clip:

      large1_btn.onPress = function (){
      _root.largeWorks_mc.gotoAndStop(5);
      }
        • 1. controlling a movie clip timeline
          Sketchsta Level 1
          double check the target.

          maybe something like..

          large1_btn.onPress = function (){
          _root.largeWorksE_mc.largeWorks_mc.gotoAndStop(5);
          }

          because largeWorks_mc is inside largeWorksE_mc.
          • 2. Re: controlling a movie clip timeline
            Opera Rat Level 1
            I've change the script to this and it still doesn't work:

            large1_btn.onPress = function (){
            _root.largeWorksE_mc.largeWorks_mc.gotoAndStop(5);
            }

            I tried: _root.gotoAndStop(5) just to see if the button was getting any response and it was. It took me to frame 5 of the root timeline. (But that does me no good).

            So it is a movieClip to movieClip communication problem that I just can't see to solve? Would attach movie help me? Can any one see the error I'm not?

            Please help me - I've been stumped by this problem for 4 days now. Thanks.
            • 3. Re: controlling a movie clip timeline
              Opera Rat Level 1
              Could it be that the instance that it just loaded of the movie clip doesn't have a name. How would you name an instance of a loaded movie clip?
              • 4. controlling a movie clip timeline
                Sketchsta Level 1
                to give a Instance name to a movieClip, select it and at the bottom left of your screen you should see a field with gray text, called " Instance Name "

                also, if you want to be specific when targeting symbols by clicking the Target button t the top of your actions pannel, that will list all of your movieClips in the FLA, and alert you if you are trying to access a movieClip that hasn't got an Instance Name.
                • 5. Re: controlling a movie clip timeline
                  kglad Adobe Community Professional & MVP
                  just use:

                  • 6. Re: controlling a movie clip timeline
                    Opera Rat Level 1
                    The only problem with that is that the instance doesn't load until you click a button. So that while the movie is running, you click on a button and it puts in a movie clip called largeWorks into the empty movie clip placeholder largeworksE_mc. So times I get an error that says

                    The debugger says Movie Clip: Frame=1 Target="_level0.largeEmpty_mc.instance23" and makes no mention of the loaded movie clip. It should read _level0.largeEmpty_mc.instanceXX.largeWorks_mc"

                    And I can't use the instance box to name an instance of a movie that hasn't and won't load until the movie is running. It's like opening a MIAW in Director. I'm about to give up on this. I thought that my mistake is one of those obvious one's. Thanks for trying.
                    • 7. Re: controlling a movie clip timeline
                      Sketchsta Level 1
                      are you loading largeWorks_mc from the library?

                      if so, use attatchMovie()
                      kglad would be more help there.

                      if you are loading it from external path, i always use a listener something like...
                      listener_mc.onLoadInit = function(){ tell the movie what to do };
                      • 8. Re: controlling a movie clip timeline
                        Opera Rat Level 1
                        I am not loading it from the library.

                        kglad suggestion is what should work, but doesn't.

                        Why do I need a listener and how would I use it?

                        When I push a button the movie clip loads in the place holder where it is supposed to and it just sits there (there is a stop() command in its timeline). Then if I click on a thumbnail from a movie clip of several thumbnails it should just tell the loaded movie clip to move a specific frame within it's independent timeline.

                        I am really completely baffled.
                        • 9. Re: controlling a movie clip timeline
                          Sketchsta Level 1
                          well the way i do it is use a movieClipLoader()
                          this will load your external swf, and once it's fully loaded it goes to frame 5.

                          try this..
                          • 10. Re: controlling a movie clip timeline
                            Sketchsta Level 1

                            this problem should be really simple, just targeting issues i think.

                            but i dont think im understanding exactly what you want to happen, and when.
                            can you publish your swf online, so that i can have a look and understand better what it is you want to happen and from what buttons.
                            • 11. Re: controlling a movie clip timeline
                              kglad Adobe Community Professional & MVP
                              that error message about _level0.largeEmpty_mc.instance23 has nothing to do with any code you've posted here. i know you're loading largeWorks_mc.swf, but that has no relationship to that error message.

                              you must have a movieclip on your _level0 timeline with instance name largeEmpty_mc that's causing confusion.

                              and, if you're confused by that, there's a fair chance that you have a movieclip in largeWorks_mc.swf whose timeline you're trying to control. is that true? (ie, you DON'T want to direct the main timeline of largeWorks_mc.swf but a movieclip that's on the main timeline of largeWorks_mc.swf?)
                              • 12. Re: controlling a movie clip timeline
                                Opera Rat Level 1
                                Yes, I'm loading largeWorks_mc into the target movie clip _root.largeEmpty_mc.

                                Let me see if I can explain this better. If you look at the old version (the one that loads the entire flash file at once), you can see the different areas of the movie I am talking about. You can see it at anthonysmithjr.com and then view the gallery. I've just added about 50 new pics and don't want to keep the gallery the way it is now - loading everything at once. So each section of the gallery will load when you go to it - large works and small works.

                                The thumbnails are a movie clip within the root movie. Then the large version of the pics are another movie clip in the root movie. So when your looking at the large work section your seeing the main movie (the purple background and buttons) and 2 movie clips (thumbnails and largeWorks). I no longer want large works movie clip to load when the movie is opened because it takes too long. So in a version that I have not put up yet I have the code:

                                gotoAndStop(6)
                                loadMovie("largeWorks_mc.swf",_root.largeWorksE_mc);

                                when you click on the large works tab. This loads the movie clip of the large version of the pics and it also take you to frame 6 or the root timeline (where the large works thumbnail clip is located).

                                When I click on a thumbnail in the movie clip largeThumbnails_mc in the root movie it should tell the movie clip that loaded next to it to go to the frame that contains that the large version of that thumbnail.

                                So I do want to control the only timeline in largeWorks_mc (just 50 frames of pics) from the other movie clip in the root movie. See the site and see if this is any clearer.

                                I really appreciate your help. I'm gutting my bathroom at the same time I'm trying to get this thing to work and it's driving me insane.
                                • 13. controlling a movie clip timeline
                                  Sketchsta Level 1
                                  quote:

                                  Originally posted by: Opera Rat
                                  Yes, I'm loading largeWorks_mc into the target movie clip _root.largeEmpty_mc.

                                  Let me see if I can explain this better. If you look at the old version (the one that loads the entire flash file at once), you can see the different areas of the movie I am talking about. You can see it at anthonysmithjr.com
                                  _______________________________________________
                                  There is nothing there for me.
                                  _______________________________________________
                                  and then view the gallery. I've just added about 50 new pics and don't want to keep the gallery the way it is now - loading everything at once. So each section of the gallery will load when you go to it - large works and small works.

                                  The thumbnails are a movie clip within the root movie. Then the large version of the pics are another movie clip in the root movie. So when your looking at the large work section your seeing the main movie (the purple background and buttons) and 2 movie clips (thumbnails and largeWorks). I no longer want large works movie clip to load when the movie is opened because it takes too long. So in a version that I have not put up yet I have the code:

                                  gotoAndStop(6)
                                  loadMovie("largeWorks_mc.swf",_root.largeWorksE_mc);

                                  __________________________________________________________
                                  Ok.. this code will work just fine, but instead of having both LoadMovie() and gotoAndStop() on the same frame, it might be easier to simply have
                                  gotoAndStop() on your buttons, THEN, on the frame that it goes to and stops, have the loadMovie()
                                  __________________________________________________________

                                  when you click on the large works tab. This loads the movie clip of the large version of the pics and it also take you to frame 6 or the root timeline (where the large works thumbnail clip is located).

                                  ___________________________________________________
                                  So if you were to do what i suggested, on frame six you would also have your LoadMovie() command.
                                  ___________________________________________________

                                  When I click on a thumbnail in the movie clip largeThumbnails_mc in the root movie it should tell the movie clip that loaded next to it to go to the frame that contains that the large version of that thumbnail.

                                  ___________________________________________________
                                  yes you would use something like this to target it...

                                  this. HOLDER . WHAT WAS LOADED . gotoAndStop()
                                  im using that instead of your instance names because im still abit fuzzy on what is loaded and when.
                                  ___________________________________________________

                                  So I do want to control the only timeline in largeWorks_mc (just 50 frames of pics) from the other movie clip in the root movie. See the site and see if this is any clearer.

                                  I really appreciate your help. I'm gutting my bathroom at the same time I'm trying to get this thing to work and it's driving me insane.

                                  ________________________________________________
                                  No problems.
                                  ________________________________________________