29 Replies Latest reply on May 12, 2009 11:13 AM by kglad

    movieclip layer specification...?

    esco1313 Level 1

      I started a new post, since its a new question... hope its ok.

       

      ok here's the deal:

       

      i have a movieclip that i'm calling from the library, that i'm playing on the ROOT. i was wondering, since its played from the library, is there a way to tell it above which layer to play? for example, i want it to play under the LOGO layer, but above the Background layer..

       

      it would be amazing !!!

        • 1. Re: movieclip layer specification...?
          Ned Murphy Adobe Community Professional & MVP

          You can place an empty movieclip in a layer where you need the attached object to go and attach it to that mc.

          1 person found this helpful
          • 2. Re: movieclip layer specification...?
            esco1313 Level 1

            and how would you go about to do that? (i'm still learning:P)

             

            my as looks like that:

             

            this.onRelease = function(){
            _root.attachMovie("blkFadeID","blkFade",this.getNextHighestDepth(), {_x:0, _y:0});
            _root.blkFade.onEnterFrame = function() {
            if (_root.blkFade._currentframe == 15) {
            delete this.onEnterFrame;
            _root.gotoAndStop("coffee")
            }
            }
            }

             

            thanks Ned, i know you will enlighten me!

            • 3. Re: movieclip layer specification...?
              esco1313 Level 1

              i tried this:

               

              his.onRelease = function(){
              _root.attachMovie("blkFadeID","blkFade",_root.emptyBlackMc, {_x:0, _y:0});
              _root.blkFade.onEnterFrame = function() {
              if (_root.blkFade._currentframe == 15) {
              delete this.onEnterFrame;
              _root.gotoAndStop("coffee")
              }
              }
              }

               

              Not working..

              • 4. Re: movieclip layer specification...?
                kglad Adobe Community Professional & MVP

                you're attaching to the _root movieclip.  you need to attach to the movieclip that's positioned where you want your attached movieclip to display.

                • 5. Re: movieclip layer specification...?
                  esco1313 Level 1

                  its positionned at the ROOT. but on a specified layer, right? but its at the root...

                  • 6. Re: movieclip layer specification...?
                    kglad Adobe Community Professional & MVP

                    the movieclip might be on the _root timeline, but it is not the _root timeline.  give your movieclip an instance name (say targetMC) and use:

                     

                    _root.targetMC.attachMovie(etc...)

                    • 7. Re: movieclip layer specification...?
                      esco1313 Level 1

                      so...if i get it,

                       

                      this.onRelease = function(){
                      _root.emptyBlackMc.attachMovie("blkFadeID","blkFade",this.getNextHighestDepth(), {_x:0, _y:0});
                      _root.blkFade.onEnterFrame = function() {
                      if (_root.blkFade._currentframe == 15) {
                      delete this.onEnterFrame;
                      _root.gotoAndStop("coffee")
                      }
                      }
                      }

                      but something is wrong, its just not loading.

                       

                      the emptyBlackMc is on a layer on the root timeline. that's its instance name.

                      the"blkFadeID" is the identifier Name of my black Mc. and its in the library, not on the stage.

                      the "blkFade" is the instance name i gave it with this code (??).

                       

                      this action script is written on a AS frame that is not on the root timeline. its in a Mc that is in a Mc etc...

                       

                      do you see a mistake somewhere?

                      • 8. Re: movieclip layer specification...?
                        kglad Adobe Community Professional & MVP

                        your depth assignment is problematic.  use:

                         

                        _root.emptyBlackMc.getNextHighestDepth()

                        • 9. Re: movieclip layer specification...?
                          esco1313 Level 1

                          yes, i'm back. hehe

                           

                          ok, so i tried this code, and somehow, it doesnt seem to work:

                           

                          this.onRelease = function(){
                          _root.attachMovie("blkFadeID","blkFade",_root.emptyMc.getNextHighestDepth());

                          _root.blkFade.onEnterFrame = function() {
                          if (_root.blkFade._currentframe == 15) {
                          delete this.onEnterFrame;
                          _root.gotoAndStop("coffee")
                          }
                          }
                          }

                           

                          Just to make sure (cause everything seems perfectly logic...), blkFadeID is the name i entered in my Mc properties. And the blkFade is the instance name that is created by this code. and if i understand... it says: attach the Mc "blkFadeID" and create the"blkFade"instance name, AND attach it to emptyMc which is at the root (and getNextHighestDepth i dont know).

                           

                          am i right? why isnt it working? arggggghhh!!!!

                          • 10. Re: movieclip layer specification...?
                            kglad Adobe Community Professional & MVP

                             

                            this.onRelease = function(){  //
                            _root.emptyMc.attachMovie("blkFadeID","blkFade",_root.emptyMc.getNextHighestDepth());

                            _root.blkFade.onEnterFrame = function() {
                            if (_root.blkFade._currentframe == 15) {
                            delete this.onEnterFrame;
                            _root.gotoAndStop("coffee")
                            }
                            }
                            }

                             


                            • 11. Re: movieclip layer specification...?
                              esco1313 Level 1

                              i love you.

                              • 12. Re: movieclip layer specification...?
                                esco1313 Level 1

                                ok... not that fast... hehe it seems to have created a new problem.

                                 

                                 

                                this.onRelease = function(){ 
                                _root.emptyMc.attachMovie("blkFadeID","blkFade",_root.emptyMc.getNextHighestDepth());
                                _root.blkFade.onEnterFrame = function() {
                                if (_root.blkFade._currentframe == 15) {
                                delete this.onEnterFrame;
                                _root.gotoAndStop("coffee")
                                }
                                }
                                }

                                 

                                 

                                it used to play the blackFade, and then, go to my frame. Now, it only plays the fade, and wont go to my frame after..:'(

                                 

                                any idea?

                                • 13. Re: movieclip layer specification...?
                                  kglad Adobe Community Professional & MVP

                                  there is no _root.blkFade any more.  use _root.emptyMc.blkFade:

                                   

                                  esco1313 wrote:

                                   

                                  ok... not that fast... hehe it seems to have created a new problem.

                                   

                                   

                                  this.onRelease = function(){ 
                                  _root.emptyMc.attachMovie("blkFadeID","blkFade",_root.emptyMc.getNextHighestDept h());
                                  _root.emptyMc.blkFade.onEnterFrame = function() {
                                  if (_root.emptyMc.blkFade._currentframe == 15) {
                                  delete this.onEnterFrame;
                                  _root.gotoAndStop("coffee")
                                  }
                                  }
                                  }

                                   

                                   

                                  it used to play the blackFade, and then, go to my frame. Now, it only plays the fade, and wont go to my frame after..:'(

                                   

                                  any idea?

                                  1 person found this helpful
                                  • 14. Re: movieclip layer specification...?
                                    esco1313 Level 1

                                    are you ALWAYS right? still love you man.

                                     

                                    t h a n k    y o u.

                                    • 15. Re: movieclip layer specification...?
                                      kglad Adobe Community Professional & MVP

                                      you're welcome.

                                      • 16. Re: movieclip layer specification...?
                                        esco1313 Level 1

                                        guess what... another problem created...

                                         

                                        so i'll explain:

                                         

                                        its a picture gallery. so:

                                         

                                        1st button

                                         

                                        this.onRelease = function(){ 
                                        _root.emptyMc.attachMovie("blkFadeID","blkFade",_root.emptyMc.getNextHighestDepth());
                                        _root.emptyMc.blkFade.onEnterFrame = function() {
                                        if (_root.emptyMc.blkFade._currentframe == 15) {
                                        delete this.onEnterFrame;
                                        _root.gotoAndStop("coffee")
                                        }
                                        }
                                        }

                                         

                                        2nd button

                                         

                                        this.onRelease = function(){ 
                                        _root.emptyMc.attachMovie("blkFadeID","blkFade",_root.emptyMc.getNextHighestDepth());
                                        _root.emptyMc.blkFade.onEnterFrame = function() {
                                        if (_root.emptyMc.blkFade._currentframe == 15) {
                                        delete this.onEnterFrame;
                                        _root.gotoAndStop("huile")
                                        }
                                        }
                                        }

                                         

                                        3rd button

                                         

                                        this.onRelease = function(){ 
                                        _root.emptyMc.attachMovie("blkFadeID","blkFade",_root.emptyMc.getNextHighestDepth());
                                        _root.emptyMc.blkFade.onEnterFrame = function() {
                                        if (_root.emptyMc.blkFade._currentframe == 15) {
                                        delete this.onEnterFrame;
                                        _root.gotoAndStop("coupe")
                                        }
                                        }
                                        }

                                         

                                        etc...

                                         

                                        but when i click on one of them, it works. when i click on another one, the fade fades, and stays on the same image. it doesnt go on to the next picture....

                                         

                                        can u help on this?

                                         

                                        i wish i mastered AS...

                                        • 17. Re: movieclip layer specification...?
                                          kglad Adobe Community Professional & MVP

                                          i'm not sure what you're describing but you're going to have a problem giving those movieclips the same name.

                                           

                                          instead of naming them all blkFade, maybe call them blkFade1, blkFade2 etc.

                                          • 18. Re: movieclip layer specification...?
                                            esco1313 Level 1

                                            ok whats happening is this:

                                             

                                            i have lets say 3 frames labeled "coffee", "huile" and "coupe" on the root stage. i have 3 buttons (thumbnails) in a movieclip. i have a blkFade mc (in the library). what i'm trying to achieve is this: when i click on any of the buttons, i want it to play the blkFade first, then go to the frame labeled, depending on which button i click. So, the blkFade is really only one mc that i want to re-use as a transition.

                                            • 19. Re: movieclip layer specification...?
                                              kglad Adobe Community Professional & MVP

                                              if you want the goto methods to execute after the fade completes, you need to remove the goto statements from their current location and direct the _root timeline at the end of the fade.

                                               

                                              you can assign a variable in your mouse handlers to use in a goto at the end of the fade or call a function from the end of the fade.

                                              • 20. Re: movieclip layer specification...?
                                                esco1313 Level 1

                                                ok. i have no possible clue of what you are talking about. however, i wouldnt want to waste your time to explain. i know for a fact that when my blkFade mc used to play at the root, the buttons worked just fine. it seems that when i fixed that problem, THEN it stopped working properly. why is that? did we dd something that changed everything? or was i doing it wrong since the begining? because it worked fine 1 hour ago, but the fade was on top of everything. now that its in place, the buttons dont work anymore:'(

                                                • 21. Re: movieclip layer specification...?
                                                  esco1313 Level 1

                                                  and it seems so logic that i'm just calling a frame label...

                                                  i looks like if i needed to add a code to "reset" or "unload" the frame or movie clip...?

                                                  • 22. Re: movieclip layer specification...?
                                                    esco1313 Level 1

                                                    ok. i've managed to remember the code that was working...

                                                     

                                                    this works but the fade is on top of everything

                                                     

                                                    this.onRelease = function(){
                                                    _root.attachMovie("blkFadeID","blkFade",_root.getNextHighestDepth());
                                                    _root.blkFade.onEnterFrame = function() {
                                                    if (_root.blkFade._currentframe == 15) {
                                                    delete this.onEnterFrame;
                                                    _root.gotoAndStop("coffee")
                                                    }
                                                    }
                                                    }

                                                     

                                                    here, the fade is properly placed (layerwise), but the buttons only work for the first click

                                                     

                                                    this.onRelease = function(){
                                                    _root.emptyMc.attachMovie("blkFadeID","blkFade",_root.emptyMc.getNextHighestDepth());
                                                    _root.emptyMc.blkFade.onEnterFrame = function() {
                                                    if (_root.emptyMc.blkFade._currentframe == 15) {
                                                    delete this.onEnterFrame;
                                                    _root.gotoAndStop("coffee")
                                                    }
                                                    }
                                                    }

                                                     

                                                    any idea?

                                                    • 23. Re: movieclip layer specification...?
                                                      kglad Adobe Community Professional & MVP

                                                      you should be using different movieclip names and removing the blkFade movieclips:

                                                       


                                                       

                                                      this.onRelease = function(){
                                                      _root.emptyMc.attachMovie("blkFadeID","blkFade1",_root.emptyMc.getNextHighestDept h());
                                                      _root.emptyMc.blkFade1.onEnterFrame = function() {
                                                      if (_root.emptyMc.blkFade1._currentframe == 15) {
                                                      delete this.onEnterFrame;

                                                      _root.emptyMc.blkFade1.removeMovieClip();
                                                      _root.gotoAndStop("coffee")
                                                      }
                                                      }
                                                      }

                                                       

                                                      any idea?

                                                      • 24. Re: movieclip layer specification...?
                                                        esco1313 Level 1

                                                        you my friend....youre good you... i'm almost there...

                                                         

                                                        this.onRelease = function(){
                                                        _root.emptyMc.attachMovie("blkFadeID","blkFade2",_root.emptyMc.getNextHighestDepth());
                                                        _root.emptyMc.blkFade2.onEnterFrame = function() {
                                                        if (_root.emptyMc.blkFade2._currentframe == 15) {
                                                        delete this.onEnterFrame;
                                                        _root.emptyMc.blkFade2.removeMovieClip();
                                                        _root.gotoAndStop("huile")

                                                        }
                                                        }
                                                        }

                                                         

                                                        the blkFade2 has a total of 30 frames, where 15 is the center (which the black has faded in completely, but not out). this code tells it to remove the movie clip when it reaches 15. now if i change it to 30, the fade is gonna happen, and fade out, and then the picture will appear (which is not what i want, because im trying to simulate a fade).

                                                         

                                                        what i need (hope its possible) is this:

                                                         

                                                        this.onRelease = function(){
                                                        _root.emptyMc.attachMovie("blkFadeID","blkFade2",_root.emptyMc.getNextHighestDepth());
                                                        _root.emptyMc.blkFade2.onEnterFrame = function() {
                                                        if (_root.emptyMc.blkFade2._currentframe == 15) {
                                                        delete this.onEnterFrame;
                                                        _root.emptyMc.blkFade2.removeMovieClip();
                                                        _root.gotoAndStop("huile") WHILE CONTINUING TO PLAY THE FADE OUT, WHICH IS FRAM 15 TO 30
                                                        }
                                                        }
                                                        }

                                                         

                                                        but i cant because we're removing the Mc....now while writing this, i'm realising that it may not be possible...

                                                         

                                                        any hints Yoda-kglad?

                                                        • 25. Re: movieclip layer specification...?
                                                          esco1313 Level 1

                                                          there is one OTHER solution... if its too complicated to code it, i might as well animate a black fade OUT from each frame i'm calling...AHA!

                                                           

                                                          what is your opinion on that?

                                                          • 26. Re: movieclip layer specification...?
                                                            esco1313 Level 1

                                                            ok i just tried iot, and its not working. i dont know why. even if the frame i call has a 15 frames animation, it seems to bypass it...

                                                            • 27. Re: movieclip layer specification...?
                                                              kglad Adobe Community Professional & MVP

                                                              try:


                                                               

                                                              this.onRelease = function(){
                                                              _root.emptyMc.attachMovie("blkFadeID","blkFade2",_root.emptyMc.getNextHighestDep th());
                                                              _root.emptyMc.blkFade2.onEnterFrame = function() {
                                                              if (_root.emptyMc.blkFade2._currentframe == 15) {
                                                              _root.gotoAndStop("huile")

                                                              } else if(_root.emptyMc.blkFade2._currentframe==30){


                                                              delete this.onEnterFrame;

                                                              _root.emptyMc.blkFade2.removeMovieClip();

                                                              }

                                                              }
                                                              }

                                                               


                                                              • 28. Re: movieclip layer specification...?
                                                                esco1313 Level 1

                                                                you did it again. did you invent actionscript?:P

                                                                 

                                                                thanks a lot for your time man.

                                                                • 29. Re: movieclip layer specification...?
                                                                  kglad Adobe Community Professional & MVP

                                                                  you're welcome.