1 2 Previous Next 53 Replies Latest reply on Sep 30, 2006 4:57 PM by Newsgroup_User

    Swap MovieClips

    GellyBean
      Scenario: I have 3 pictures (MC) that I would like to have played one on top of the other.
      My problem is that when the last MC is played, the first one appears abruptly, rather than appearing on top of the last MC played.

      Which is the script to have the first MC play one on top of the last, constantly?
        • 1. Re: Swap MovieClips
          Level 7
          GellyBean,

          > Scenario: I have 3 pictures (MC) that I would like to have
          > played one on top of the other.

          Okay.

          > My problem is that when the last MC is played, the first one
          > appears abruptly, rather than appearing on top of the last
          > MC played.

          I'm not sure what you mean by "abruptly" in this context, I guess. Are
          you talking about an issue with which image is on top? Abruptly could be
          interpreted as "suddenly," which doesn't intrinsically have anything to do
          with layering -- see what I mean? Just trying to understand. :)

          > Which is the script to have the first MC play one on top of
          > the last, constantly?

          Well, there's a method of the MovieClip class called
          MovieClip.swapDepths(). That seems to match the subject line of your post.
          Is that what you're after?


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


          • 2. Re: Swap MovieClips
            GellyBean Level 1
            Mr Stiller,

            quote:

            Well, there's a method of the MovieClip class called
            MovieClip.swapDepths(). That seems to match the subject line of your post.
            Is that what you're after?



            I think that's exactly what I want. I would like to put those 3+ pictures (wiht effect) in one MC and swap each one on top of the other.
            • 3. Re: Swap MovieClips
              Level 7
              GellyBean,

              >> MovieClip.swapDepths(). That seems to match the
              >> subject line of your post. Is that what you're after?

              > I think that's exactly what I want. I would like to put those
              > 3+ pictures (wiht effect) in one MC and swap each one on
              > top of the other.

              That may be it, then. :) Note in the documentation that
              MovieClip.swapDepths() can be used two ways: one allows you to swap the
              depth of one movie clip with another; the other allows you to set the depth
              of a movie clip using a number.

              So you could either keep swapping clips, as desired, or use something
              like MovieClip.getNextHighestDepth(), which returns a number.


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


              • 4. Re: Swap MovieClips
                GellyBean Level 1
                quote:

                That may be it, then. :) Note in the documentation that
                MovieClip.swapDepths() can be used two ways: one allows you to swap the
                depth of one movie clip with another; the other allows you to set the depth
                of a movie clip using a number.

                So... How can I do it ???

                • 5. Re: Swap MovieClips
                  Level 7
                  GellyBean,

                  > So... How can I do it ???

                  Have you looked up the MovieClip.swapDepths() method in the ActionScript
                  2.0 Language Reference? ;)


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


                  • 6. Re: Swap MovieClips
                    GellyBean Level 1
                    Thank you David,
                    I see the function of swap depths and I think that is not what I am really looking for.
                    I also think that, because I have not explained myself well, as I really don't want to click the images in order to see them.
                    The images come up by themselves.

                    Inside my flash movie, I have a rotating banner with 3 pics inside (each picture appears with a mask effect). What I mean, is that each picture is a MC. I would like it, that each picture appears, one on top of the other, every X amount of time.
                    • 7. Re: Swap MovieClips
                      Level 7
                      GellyBean,

                      > I see the function of swap depths and I think that is not
                      > what I am really looking for.

                      Okay.

                      > I also think that, because I have not explained myself
                      > well, as I really don't want to click the images in order
                      > to see them.

                      That's fine. None of these functions require buttons. :)

                      > The images come up by themselves.

                      Okay.

                      > Inside my flash movie, I have a rotating banner with 3
                      > pics inside (each picture appears with a mask effect).

                      I think I can picture that -- of course, what I envision may be
                      different from what it actually is.

                      > What I mean, is that each picture is a MC. I would like
                      > it, that each picture appears, one on top of the other,
                      > every X amount of time.

                      In order for clipA to appear on top of clipB, clipA must be higher than
                      clipB. If it isn't already, the only way to arrange that via ActionScript
                      is with the MovieClip.swapDepths() method.


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


                      • 8. Re: Swap MovieClips
                        GellyBean Level 1
                        I made a MC with two layers (one 4 actions the other for pictures)
                        The code that I used is this, but it is not working*:

                        pic1_mc.play();
                        function () {
                        if (this.getDepth()<pic2_mc.getDepth()) {
                        this.swapDepths(pic2_mc);
                        }
                        }
                        pic2_mc.play();
                        function () {
                        if (this.getDepth()<pic1_mc.getDepth()) {
                        this.swapDepths(pic1_mc);
                        }
                        }


                        *(I'm sorry if I'm annoying you but I'm new in this stuff)
                        • 9. Re: Swap MovieClips
                          Level 7
                          GellyBean,

                          > I made a MC with two layers (one 4 actions the
                          > other for pictures) The code that I used is this,
                          > but it is not working

                          > pic1_mc.play();
                          > function () {
                          > if (this.getDepth()<pic2_mc.getDepth()) {
                          > this.swapDepths(pic2_mc);
                          > }
                          > }

                          In the first line, you're telling a movie clip whose instance name is
                          pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                          If so, consider the "point of view" of this ActionScript. If you're already
                          inside pic1_mc, this code is going to look for an object named pic1_mc ...
                          are you going to find it? It's interesting to me that you used "this" in
                          the function, because "this" refers to the object or timeline it's in.
                          Depending on your circumstances, "this" might refers to pic1_mc; it might
                          not.

                          You can use the trace() function to kind of help you "see under the
                          hood." Before you do anything else, you'll have to actually *run* the
                          function. You're written one, but you aren't calling it anywhere.

                          function test() {
                          trace("Hi there");
                          }

                          On its own, that doesn't do anything. To call this function, type
                          test() ... make sense? You don't have to type it right away. In you might,
                          for example, call the test() function from inside a button, whenever the
                          user gets around to clicking ... or you might call the test() function in a
                          later frame of that timeline -- or any other timeline or object that can
                          path to the timeline in which the function was written.

                          e.g. if the function is written inside clipA, you can call it from the
                          main timeline -- assuming clipA is in the main timeline -- like this ...

                          clipA.test();

                          If this were my project, I'd probably put all the ActionScript in frames
                          of the main timeline, rather than inside the clips themselves. Just give
                          each clip an instance name and then call each by name from the main
                          timeline, telling it what to do -- based on the properties, methods, and
                          events described in that object's (in this case, the MovieClip) class.


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


                          • 10. Re: Swap MovieClips
                            Level 7
                            GellyBean,

                            > I made a MC with two layers (one 4 actions the
                            > other for pictures) The code that I used is this,
                            > but it is not working

                            > pic1_mc.play();
                            > function () {
                            > if (this.getDepth()<pic2_mc.getDepth()) {
                            > this.swapDepths(pic2_mc);
                            > }
                            > }

                            In the first line, you're telling a movie clip whose instance name is
                            pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                            If so, consider the "point of view" of this ActionScript. If you're already
                            inside pic1_mc, this code is going to look for an object named pic1_mc ...
                            are you going to find it? It's interesting to me that you used "this" in
                            the function, because "this" refers to the object or timeline it's in.
                            Depending on your circumstances, "this" might refers to pic1_mc; it might
                            not.

                            You can use the trace() function to kind of help you "see under the
                            hood." Before you do anything else, you'll have to actually *run* the
                            function. You're written one, but you aren't calling it anywhere.

                            function test() {
                            trace("Hi there");
                            }

                            On its own, that doesn't do anything. To call this function, type
                            test() ... make sense? You don't have to type it right away. In you might,
                            for example, call the test() function from inside a button, whenever the
                            user gets around to clicking ... or you might call the test() function in a
                            later frame of that timeline -- or any other timeline or object that can
                            path to the timeline in which the function was written.

                            e.g. if the function is written inside clipA, you can call it from the
                            main timeline -- assuming clipA is in the main timeline -- like this ...

                            clipA.test();

                            If this were my project, I'd probably put all the ActionScript in frames
                            of the main timeline, rather than inside the clips themselves. Just give
                            each clip an instance name and then call each by name from the main
                            timeline, telling it what to do -- based on the properties, methods, and
                            events described in that object's (in this case, the MovieClip) class.


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


                            • 11. Re: Swap MovieClips
                              Level 7
                              GellyBean,

                              > I made a MC with two layers (one 4 actions the
                              > other for pictures) The code that I used is this,
                              > but it is not working

                              > pic1_mc.play();
                              > function () {
                              > if (this.getDepth()<pic2_mc.getDepth()) {
                              > this.swapDepths(pic2_mc);
                              > }
                              > }

                              In the first line, you're telling a movie clip whose instance name is
                              pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                              If so, consider the "point of view" of this ActionScript. If you're already
                              inside pic1_mc, this code is going to look for an object named pic1_mc ...
                              are you going to find it? It's interesting to me that you used "this" in
                              the function, because "this" refers to the object or timeline it's in.
                              Depending on your circumstances, "this" might refers to pic1_mc; it might
                              not.

                              You can use the trace() function to kind of help you "see under the
                              hood." Before you do anything else, you'll have to actually *run* the
                              function. You're written one, but you aren't calling it anywhere.

                              function test() {
                              trace("Hi there");
                              }

                              On its own, that doesn't do anything. To call this function, type
                              test() ... make sense? You don't have to type it right away. In you might,
                              for example, call the test() function from inside a button, whenever the
                              user gets around to clicking ... or you might call the test() function in a
                              later frame of that timeline -- or any other timeline or object that can
                              path to the timeline in which the function was written.

                              e.g. if the function is written inside clipA, you can call it from the
                              main timeline -- assuming clipA is in the main timeline -- like this ...

                              clipA.test();

                              If this were my project, I'd probably put all the ActionScript in frames
                              of the main timeline, rather than inside the clips themselves. Just give
                              each clip an instance name and then call each by name from the main
                              timeline, telling it what to do -- based on the properties, methods, and
                              events described in that object's (in this case, the MovieClip) class.


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


                              • 12. Re: Swap MovieClips
                                Level 7
                                GellyBean,

                                > I made a MC with two layers (one 4 actions the
                                > other for pictures) The code that I used is this,
                                > but it is not working

                                > pic1_mc.play();
                                > function () {
                                > if (this.getDepth()<pic2_mc.getDepth()) {
                                > this.swapDepths(pic2_mc);
                                > }
                                > }

                                In the first line, you're telling a movie clip whose instance name is
                                pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                If so, consider the "point of view" of this ActionScript. If you're already
                                inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                are you going to find it? It's interesting to me that you used "this" in
                                the function, because "this" refers to the object or timeline it's in.
                                Depending on your circumstances, "this" might refers to pic1_mc; it might
                                not.

                                You can use the trace() function to kind of help you "see under the
                                hood." Before you do anything else, you'll have to actually *run* the
                                function. You're written one, but you aren't calling it anywhere.

                                function test() {
                                trace("Hi there");
                                }

                                On its own, that doesn't do anything. To call this function, type
                                test() ... make sense? You don't have to type it right away. In you might,
                                for example, call the test() function from inside a button, whenever the
                                user gets around to clicking ... or you might call the test() function in a
                                later frame of that timeline -- or any other timeline or object that can
                                path to the timeline in which the function was written.

                                e.g. if the function is written inside clipA, you can call it from the
                                main timeline -- assuming clipA is in the main timeline -- like this ...

                                clipA.test();

                                If this were my project, I'd probably put all the ActionScript in frames
                                of the main timeline, rather than inside the clips themselves. Just give
                                each clip an instance name and then call each by name from the main
                                timeline, telling it what to do -- based on the properties, methods, and
                                events described in that object's (in this case, the MovieClip) class.


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


                                • 13. Re: Swap MovieClips
                                  Level 7
                                  GellyBean,

                                  > I made a MC with two layers (one 4 actions the
                                  > other for pictures) The code that I used is this,
                                  > but it is not working

                                  > pic1_mc.play();
                                  > function () {
                                  > if (this.getDepth()<pic2_mc.getDepth()) {
                                  > this.swapDepths(pic2_mc);
                                  > }
                                  > }

                                  In the first line, you're telling a movie clip whose instance name is
                                  pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                  If so, consider the "point of view" of this ActionScript. If you're already
                                  inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                  are you going to find it? It's interesting to me that you used "this" in
                                  the function, because "this" refers to the object or timeline it's in.
                                  Depending on your circumstances, "this" might refers to pic1_mc; it might
                                  not.

                                  You can use the trace() function to kind of help you "see under the
                                  hood." Before you do anything else, you'll have to actually *run* the
                                  function. You're written one, but you aren't calling it anywhere.

                                  function test() {
                                  trace("Hi there");
                                  }

                                  On its own, that doesn't do anything. To call this function, type
                                  test() ... make sense? You don't have to type it right away. In you might,
                                  for example, call the test() function from inside a button, whenever the
                                  user gets around to clicking ... or you might call the test() function in a
                                  later frame of that timeline -- or any other timeline or object that can
                                  path to the timeline in which the function was written.

                                  e.g. if the function is written inside clipA, you can call it from the
                                  main timeline -- assuming clipA is in the main timeline -- like this ...

                                  clipA.test();

                                  If this were my project, I'd probably put all the ActionScript in frames
                                  of the main timeline, rather than inside the clips themselves. Just give
                                  each clip an instance name and then call each by name from the main
                                  timeline, telling it what to do -- based on the properties, methods, and
                                  events described in that object's (in this case, the MovieClip) class.


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


                                  • 14. Re: Swap MovieClips
                                    Level 7
                                    GellyBean,

                                    > I made a MC with two layers (one 4 actions the
                                    > other for pictures) The code that I used is this,
                                    > but it is not working

                                    > pic1_mc.play();
                                    > function () {
                                    > if (this.getDepth()<pic2_mc.getDepth()) {
                                    > this.swapDepths(pic2_mc);
                                    > }
                                    > }

                                    In the first line, you're telling a movie clip whose instance name is
                                    pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                    If so, consider the "point of view" of this ActionScript. If you're already
                                    inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                    are you going to find it? It's interesting to me that you used "this" in
                                    the function, because "this" refers to the object or timeline it's in.
                                    Depending on your circumstances, "this" might refers to pic1_mc; it might
                                    not.

                                    You can use the trace() function to kind of help you "see under the
                                    hood." Before you do anything else, you'll have to actually *run* the
                                    function. You're written one, but you aren't calling it anywhere.

                                    function test() {
                                    trace("Hi there");
                                    }

                                    On its own, that doesn't do anything. To call this function, type
                                    test() ... make sense? You don't have to type it right away. In you might,
                                    for example, call the test() function from inside a button, whenever the
                                    user gets around to clicking ... or you might call the test() function in a
                                    later frame of that timeline -- or any other timeline or object that can
                                    path to the timeline in which the function was written.

                                    e.g. if the function is written inside clipA, you can call it from the
                                    main timeline -- assuming clipA is in the main timeline -- like this ...

                                    clipA.test();

                                    If this were my project, I'd probably put all the ActionScript in frames
                                    of the main timeline, rather than inside the clips themselves. Just give
                                    each clip an instance name and then call each by name from the main
                                    timeline, telling it what to do -- based on the properties, methods, and
                                    events described in that object's (in this case, the MovieClip) class.


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


                                    • 15. Re: Swap MovieClips
                                      Level 7
                                      GellyBean,

                                      > I made a MC with two layers (one 4 actions the
                                      > other for pictures) The code that I used is this,
                                      > but it is not working

                                      > pic1_mc.play();
                                      > function () {
                                      > if (this.getDepth()<pic2_mc.getDepth()) {
                                      > this.swapDepths(pic2_mc);
                                      > }
                                      > }

                                      In the first line, you're telling a movie clip whose instance name is
                                      pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                      If so, consider the "point of view" of this ActionScript. If you're already
                                      inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                      are you going to find it? It's interesting to me that you used "this" in
                                      the function, because "this" refers to the object or timeline it's in.
                                      Depending on your circumstances, "this" might refers to pic1_mc; it might
                                      not.

                                      You can use the trace() function to kind of help you "see under the
                                      hood." Before you do anything else, you'll have to actually *run* the
                                      function. You're written one, but you aren't calling it anywhere.

                                      function test() {
                                      trace("Hi there");
                                      }

                                      On its own, that doesn't do anything. To call this function, type
                                      test() ... make sense? You don't have to type it right away. In you might,
                                      for example, call the test() function from inside a button, whenever the
                                      user gets around to clicking ... or you might call the test() function in a
                                      later frame of that timeline -- or any other timeline or object that can
                                      path to the timeline in which the function was written.

                                      e.g. if the function is written inside clipA, you can call it from the
                                      main timeline -- assuming clipA is in the main timeline -- like this ...

                                      clipA.test();

                                      If this were my project, I'd probably put all the ActionScript in frames
                                      of the main timeline, rather than inside the clips themselves. Just give
                                      each clip an instance name and then call each by name from the main
                                      timeline, telling it what to do -- based on the properties, methods, and
                                      events described in that object's (in this case, the MovieClip) class.


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


                                      • 16. Re: Swap MovieClips
                                        Level 7
                                        GellyBean,

                                        > I made a MC with two layers (one 4 actions the
                                        > other for pictures) The code that I used is this,
                                        > but it is not working

                                        > pic1_mc.play();
                                        > function () {
                                        > if (this.getDepth()<pic2_mc.getDepth()) {
                                        > this.swapDepths(pic2_mc);
                                        > }
                                        > }

                                        In the first line, you're telling a movie clip whose instance name is
                                        pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                        If so, consider the "point of view" of this ActionScript. If you're already
                                        inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                        are you going to find it? It's interesting to me that you used "this" in
                                        the function, because "this" refers to the object or timeline it's in.
                                        Depending on your circumstances, "this" might refers to pic1_mc; it might
                                        not.

                                        You can use the trace() function to kind of help you "see under the
                                        hood." Before you do anything else, you'll have to actually *run* the
                                        function. You're written one, but you aren't calling it anywhere.

                                        function test() {
                                        trace("Hi there");
                                        }

                                        On its own, that doesn't do anything. To call this function, type
                                        test() ... make sense? You don't have to type it right away. In you might,
                                        for example, call the test() function from inside a button, whenever the
                                        user gets around to clicking ... or you might call the test() function in a
                                        later frame of that timeline -- or any other timeline or object that can
                                        path to the timeline in which the function was written.

                                        e.g. if the function is written inside clipA, you can call it from the
                                        main timeline -- assuming clipA is in the main timeline -- like this ...

                                        clipA.test();

                                        If this were my project, I'd probably put all the ActionScript in frames
                                        of the main timeline, rather than inside the clips themselves. Just give
                                        each clip an instance name and then call each by name from the main
                                        timeline, telling it what to do -- based on the properties, methods, and
                                        events described in that object's (in this case, the MovieClip) class.


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


                                        • 17. Re: Swap MovieClips
                                          Level 7
                                          GellyBean,

                                          > I made a MC with two layers (one 4 actions the
                                          > other for pictures) The code that I used is this,
                                          > but it is not working

                                          > pic1_mc.play();
                                          > function () {
                                          > if (this.getDepth()<pic2_mc.getDepth()) {
                                          > this.swapDepths(pic2_mc);
                                          > }
                                          > }

                                          In the first line, you're telling a movie clip whose instance name is
                                          pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                          If so, consider the "point of view" of this ActionScript. If you're already
                                          inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                          are you going to find it? It's interesting to me that you used "this" in
                                          the function, because "this" refers to the object or timeline it's in.
                                          Depending on your circumstances, "this" might refers to pic1_mc; it might
                                          not.

                                          You can use the trace() function to kind of help you "see under the
                                          hood." Before you do anything else, you'll have to actually *run* the
                                          function. You're written one, but you aren't calling it anywhere.

                                          function test() {
                                          trace("Hi there");
                                          }

                                          On its own, that doesn't do anything. To call this function, type
                                          test() ... make sense? You don't have to type it right away. In you might,
                                          for example, call the test() function from inside a button, whenever the
                                          user gets around to clicking ... or you might call the test() function in a
                                          later frame of that timeline -- or any other timeline or object that can
                                          path to the timeline in which the function was written.

                                          e.g. if the function is written inside clipA, you can call it from the
                                          main timeline -- assuming clipA is in the main timeline -- like this ...

                                          clipA.test();

                                          If this were my project, I'd probably put all the ActionScript in frames
                                          of the main timeline, rather than inside the clips themselves. Just give
                                          each clip an instance name and then call each by name from the main
                                          timeline, telling it what to do -- based on the properties, methods, and
                                          events described in that object's (in this case, the MovieClip) class.


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


                                          • 18. Re: Swap MovieClips
                                            Level 7
                                            GellyBean,

                                            > I made a MC with two layers (one 4 actions the
                                            > other for pictures) The code that I used is this,
                                            > but it is not working

                                            > pic1_mc.play();
                                            > function () {
                                            > if (this.getDepth()<pic2_mc.getDepth()) {
                                            > this.swapDepths(pic2_mc);
                                            > }
                                            > }

                                            In the first line, you're telling a movie clip whose instance name is
                                            pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                            If so, consider the "point of view" of this ActionScript. If you're already
                                            inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                            are you going to find it? It's interesting to me that you used "this" in
                                            the function, because "this" refers to the object or timeline it's in.
                                            Depending on your circumstances, "this" might refers to pic1_mc; it might
                                            not.

                                            You can use the trace() function to kind of help you "see under the
                                            hood." Before you do anything else, you'll have to actually *run* the
                                            function. You're written one, but you aren't calling it anywhere.

                                            function test() {
                                            trace("Hi there");
                                            }

                                            On its own, that doesn't do anything. To call this function, type
                                            test() ... make sense? You don't have to type it right away. In you might,
                                            for example, call the test() function from inside a button, whenever the
                                            user gets around to clicking ... or you might call the test() function in a
                                            later frame of that timeline -- or any other timeline or object that can
                                            path to the timeline in which the function was written.

                                            e.g. if the function is written inside clipA, you can call it from the
                                            main timeline -- assuming clipA is in the main timeline -- like this ...

                                            clipA.test();

                                            If this were my project, I'd probably put all the ActionScript in frames
                                            of the main timeline, rather than inside the clips themselves. Just give
                                            each clip an instance name and then call each by name from the main
                                            timeline, telling it what to do -- based on the properties, methods, and
                                            events described in that object's (in this case, the MovieClip) class.


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


                                            • 19. Re: Swap MovieClips
                                              Level 7
                                              GellyBean,

                                              > I made a MC with two layers (one 4 actions the
                                              > other for pictures) The code that I used is this,
                                              > but it is not working

                                              > pic1_mc.play();
                                              > function () {
                                              > if (this.getDepth()<pic2_mc.getDepth()) {
                                              > this.swapDepths(pic2_mc);
                                              > }
                                              > }

                                              In the first line, you're telling a movie clip whose instance name is
                                              pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                              If so, consider the "point of view" of this ActionScript. If you're already
                                              inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                              are you going to find it? It's interesting to me that you used "this" in
                                              the function, because "this" refers to the object or timeline it's in.
                                              Depending on your circumstances, "this" might refers to pic1_mc; it might
                                              not.

                                              You can use the trace() function to kind of help you "see under the
                                              hood." Before you do anything else, you'll have to actually *run* the
                                              function. You're written one, but you aren't calling it anywhere.

                                              function test() {
                                              trace("Hi there");
                                              }

                                              On its own, that doesn't do anything. To call this function, type
                                              test() ... make sense? You don't have to type it right away. In you might,
                                              for example, call the test() function from inside a button, whenever the
                                              user gets around to clicking ... or you might call the test() function in a
                                              later frame of that timeline -- or any other timeline or object that can
                                              path to the timeline in which the function was written.

                                              e.g. if the function is written inside clipA, you can call it from the
                                              main timeline -- assuming clipA is in the main timeline -- like this ...

                                              clipA.test();

                                              If this were my project, I'd probably put all the ActionScript in frames
                                              of the main timeline, rather than inside the clips themselves. Just give
                                              each clip an instance name and then call each by name from the main
                                              timeline, telling it what to do -- based on the properties, methods, and
                                              events described in that object's (in this case, the MovieClip) class.


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


                                              • 20. Re: Swap MovieClips
                                                Level 7
                                                GellyBean,

                                                > I made a MC with two layers (one 4 actions the
                                                > other for pictures) The code that I used is this,
                                                > but it is not working

                                                > pic1_mc.play();
                                                > function () {
                                                > if (this.getDepth()<pic2_mc.getDepth()) {
                                                > this.swapDepths(pic2_mc);
                                                > }
                                                > }

                                                In the first line, you're telling a movie clip whose instance name is
                                                pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                If so, consider the "point of view" of this ActionScript. If you're already
                                                inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                are you going to find it? It's interesting to me that you used "this" in
                                                the function, because "this" refers to the object or timeline it's in.
                                                Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                not.

                                                You can use the trace() function to kind of help you "see under the
                                                hood." Before you do anything else, you'll have to actually *run* the
                                                function. You're written one, but you aren't calling it anywhere.

                                                function test() {
                                                trace("Hi there");
                                                }

                                                On its own, that doesn't do anything. To call this function, type
                                                test() ... make sense? You don't have to type it right away. In you might,
                                                for example, call the test() function from inside a button, whenever the
                                                user gets around to clicking ... or you might call the test() function in a
                                                later frame of that timeline -- or any other timeline or object that can
                                                path to the timeline in which the function was written.

                                                e.g. if the function is written inside clipA, you can call it from the
                                                main timeline -- assuming clipA is in the main timeline -- like this ...

                                                clipA.test();

                                                If this were my project, I'd probably put all the ActionScript in frames
                                                of the main timeline, rather than inside the clips themselves. Just give
                                                each clip an instance name and then call each by name from the main
                                                timeline, telling it what to do -- based on the properties, methods, and
                                                events described in that object's (in this case, the MovieClip) class.


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


                                                • 21. Re: Swap MovieClips
                                                  Level 7
                                                  GellyBean,

                                                  > I made a MC with two layers (one 4 actions the
                                                  > other for pictures) The code that I used is this,
                                                  > but it is not working

                                                  > pic1_mc.play();
                                                  > function () {
                                                  > if (this.getDepth()<pic2_mc.getDepth()) {
                                                  > this.swapDepths(pic2_mc);
                                                  > }
                                                  > }

                                                  In the first line, you're telling a movie clip whose instance name is
                                                  pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                  If so, consider the "point of view" of this ActionScript. If you're already
                                                  inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                  are you going to find it? It's interesting to me that you used "this" in
                                                  the function, because "this" refers to the object or timeline it's in.
                                                  Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                  not.

                                                  You can use the trace() function to kind of help you "see under the
                                                  hood." Before you do anything else, you'll have to actually *run* the
                                                  function. You're written one, but you aren't calling it anywhere.

                                                  function test() {
                                                  trace("Hi there");
                                                  }

                                                  On its own, that doesn't do anything. To call this function, type
                                                  test() ... make sense? You don't have to type it right away. In you might,
                                                  for example, call the test() function from inside a button, whenever the
                                                  user gets around to clicking ... or you might call the test() function in a
                                                  later frame of that timeline -- or any other timeline or object that can
                                                  path to the timeline in which the function was written.

                                                  e.g. if the function is written inside clipA, you can call it from the
                                                  main timeline -- assuming clipA is in the main timeline -- like this ...

                                                  clipA.test();

                                                  If this were my project, I'd probably put all the ActionScript in frames
                                                  of the main timeline, rather than inside the clips themselves. Just give
                                                  each clip an instance name and then call each by name from the main
                                                  timeline, telling it what to do -- based on the properties, methods, and
                                                  events described in that object's (in this case, the MovieClip) class.


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


                                                  • 22. Re: Swap MovieClips
                                                    Level 7
                                                    GellyBean,

                                                    > I made a MC with two layers (one 4 actions the
                                                    > other for pictures) The code that I used is this,
                                                    > but it is not working

                                                    > pic1_mc.play();
                                                    > function () {
                                                    > if (this.getDepth()<pic2_mc.getDepth()) {
                                                    > this.swapDepths(pic2_mc);
                                                    > }
                                                    > }

                                                    In the first line, you're telling a movie clip whose instance name is
                                                    pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                    If so, consider the "point of view" of this ActionScript. If you're already
                                                    inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                    are you going to find it? It's interesting to me that you used "this" in
                                                    the function, because "this" refers to the object or timeline it's in.
                                                    Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                    not.

                                                    You can use the trace() function to kind of help you "see under the
                                                    hood." Before you do anything else, you'll have to actually *run* the
                                                    function. You're written one, but you aren't calling it anywhere.

                                                    function test() {
                                                    trace("Hi there");
                                                    }

                                                    On its own, that doesn't do anything. To call this function, type
                                                    test() ... make sense? You don't have to type it right away. In you might,
                                                    for example, call the test() function from inside a button, whenever the
                                                    user gets around to clicking ... or you might call the test() function in a
                                                    later frame of that timeline -- or any other timeline or object that can
                                                    path to the timeline in which the function was written.

                                                    e.g. if the function is written inside clipA, you can call it from the
                                                    main timeline -- assuming clipA is in the main timeline -- like this ...

                                                    clipA.test();

                                                    If this were my project, I'd probably put all the ActionScript in frames
                                                    of the main timeline, rather than inside the clips themselves. Just give
                                                    each clip an instance name and then call each by name from the main
                                                    timeline, telling it what to do -- based on the properties, methods, and
                                                    events described in that object's (in this case, the MovieClip) class.


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


                                                    • 23. Re: Swap MovieClips
                                                      Level 7
                                                      GellyBean,

                                                      > I made a MC with two layers (one 4 actions the
                                                      > other for pictures) The code that I used is this,
                                                      > but it is not working

                                                      > pic1_mc.play();
                                                      > function () {
                                                      > if (this.getDepth()<pic2_mc.getDepth()) {
                                                      > this.swapDepths(pic2_mc);
                                                      > }
                                                      > }

                                                      In the first line, you're telling a movie clip whose instance name is
                                                      pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                      If so, consider the "point of view" of this ActionScript. If you're already
                                                      inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                      are you going to find it? It's interesting to me that you used "this" in
                                                      the function, because "this" refers to the object or timeline it's in.
                                                      Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                      not.

                                                      You can use the trace() function to kind of help you "see under the
                                                      hood." Before you do anything else, you'll have to actually *run* the
                                                      function. You're written one, but you aren't calling it anywhere.

                                                      function test() {
                                                      trace("Hi there");
                                                      }

                                                      On its own, that doesn't do anything. To call this function, type
                                                      test() ... make sense? You don't have to type it right away. In you might,
                                                      for example, call the test() function from inside a button, whenever the
                                                      user gets around to clicking ... or you might call the test() function in a
                                                      later frame of that timeline -- or any other timeline or object that can
                                                      path to the timeline in which the function was written.

                                                      e.g. if the function is written inside clipA, you can call it from the
                                                      main timeline -- assuming clipA is in the main timeline -- like this ...

                                                      clipA.test();

                                                      If this were my project, I'd probably put all the ActionScript in frames
                                                      of the main timeline, rather than inside the clips themselves. Just give
                                                      each clip an instance name and then call each by name from the main
                                                      timeline, telling it what to do -- based on the properties, methods, and
                                                      events described in that object's (in this case, the MovieClip) class.


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


                                                      • 24. Re: Swap MovieClips
                                                        Level 7
                                                        GellyBean,

                                                        > I made a MC with two layers (one 4 actions the
                                                        > other for pictures) The code that I used is this,
                                                        > but it is not working

                                                        > pic1_mc.play();
                                                        > function () {
                                                        > if (this.getDepth()<pic2_mc.getDepth()) {
                                                        > this.swapDepths(pic2_mc);
                                                        > }
                                                        > }

                                                        In the first line, you're telling a movie clip whose instance name is
                                                        pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                        If so, consider the "point of view" of this ActionScript. If you're already
                                                        inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                        are you going to find it? It's interesting to me that you used "this" in
                                                        the function, because "this" refers to the object or timeline it's in.
                                                        Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                        not.

                                                        You can use the trace() function to kind of help you "see under the
                                                        hood." Before you do anything else, you'll have to actually *run* the
                                                        function. You're written one, but you aren't calling it anywhere.

                                                        function test() {
                                                        trace("Hi there");
                                                        }

                                                        On its own, that doesn't do anything. To call this function, type
                                                        test() ... make sense? You don't have to type it right away. In you might,
                                                        for example, call the test() function from inside a button, whenever the
                                                        user gets around to clicking ... or you might call the test() function in a
                                                        later frame of that timeline -- or any other timeline or object that can
                                                        path to the timeline in which the function was written.

                                                        e.g. if the function is written inside clipA, you can call it from the
                                                        main timeline -- assuming clipA is in the main timeline -- like this ...

                                                        clipA.test();

                                                        If this were my project, I'd probably put all the ActionScript in frames
                                                        of the main timeline, rather than inside the clips themselves. Just give
                                                        each clip an instance name and then call each by name from the main
                                                        timeline, telling it what to do -- based on the properties, methods, and
                                                        events described in that object's (in this case, the MovieClip) class.


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


                                                        • 25. Re: Swap MovieClips
                                                          Level 7
                                                          GellyBean,

                                                          > I made a MC with two layers (one 4 actions the
                                                          > other for pictures) The code that I used is this,
                                                          > but it is not working

                                                          > pic1_mc.play();
                                                          > function () {
                                                          > if (this.getDepth()<pic2_mc.getDepth()) {
                                                          > this.swapDepths(pic2_mc);
                                                          > }
                                                          > }

                                                          In the first line, you're telling a movie clip whose instance name is
                                                          pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                          If so, consider the "point of view" of this ActionScript. If you're already
                                                          inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                          are you going to find it? It's interesting to me that you used "this" in
                                                          the function, because "this" refers to the object or timeline it's in.
                                                          Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                          not.

                                                          You can use the trace() function to kind of help you "see under the
                                                          hood." Before you do anything else, you'll have to actually *run* the
                                                          function. You're written one, but you aren't calling it anywhere.

                                                          function test() {
                                                          trace("Hi there");
                                                          }

                                                          On its own, that doesn't do anything. To call this function, type
                                                          test() ... make sense? You don't have to type it right away. In you might,
                                                          for example, call the test() function from inside a button, whenever the
                                                          user gets around to clicking ... or you might call the test() function in a
                                                          later frame of that timeline -- or any other timeline or object that can
                                                          path to the timeline in which the function was written.

                                                          e.g. if the function is written inside clipA, you can call it from the
                                                          main timeline -- assuming clipA is in the main timeline -- like this ...

                                                          clipA.test();

                                                          If this were my project, I'd probably put all the ActionScript in frames
                                                          of the main timeline, rather than inside the clips themselves. Just give
                                                          each clip an instance name and then call each by name from the main
                                                          timeline, telling it what to do -- based on the properties, methods, and
                                                          events described in that object's (in this case, the MovieClip) class.


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


                                                          • 26. Re: Swap MovieClips
                                                            Level 7
                                                            GellyBean,

                                                            > I made a MC with two layers (one 4 actions the
                                                            > other for pictures) The code that I used is this,
                                                            > but it is not working

                                                            > pic1_mc.play();
                                                            > function () {
                                                            > if (this.getDepth()<pic2_mc.getDepth()) {
                                                            > this.swapDepths(pic2_mc);
                                                            > }
                                                            > }

                                                            In the first line, you're telling a movie clip whose instance name is
                                                            pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                            If so, consider the "point of view" of this ActionScript. If you're already
                                                            inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                            are you going to find it? It's interesting to me that you used "this" in
                                                            the function, because "this" refers to the object or timeline it's in.
                                                            Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                            not.

                                                            You can use the trace() function to kind of help you "see under the
                                                            hood." Before you do anything else, you'll have to actually *run* the
                                                            function. You're written one, but you aren't calling it anywhere.

                                                            function test() {
                                                            trace("Hi there");
                                                            }

                                                            On its own, that doesn't do anything. To call this function, type
                                                            test() ... make sense? You don't have to type it right away. In you might,
                                                            for example, call the test() function from inside a button, whenever the
                                                            user gets around to clicking ... or you might call the test() function in a
                                                            later frame of that timeline -- or any other timeline or object that can
                                                            path to the timeline in which the function was written.

                                                            e.g. if the function is written inside clipA, you can call it from the
                                                            main timeline -- assuming clipA is in the main timeline -- like this ...

                                                            clipA.test();

                                                            If this were my project, I'd probably put all the ActionScript in frames
                                                            of the main timeline, rather than inside the clips themselves. Just give
                                                            each clip an instance name and then call each by name from the main
                                                            timeline, telling it what to do -- based on the properties, methods, and
                                                            events described in that object's (in this case, the MovieClip) class.


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


                                                            • 27. Re: Swap MovieClips
                                                              Level 7
                                                              GellyBean,

                                                              > I made a MC with two layers (one 4 actions the
                                                              > other for pictures) The code that I used is this,
                                                              > but it is not working

                                                              > pic1_mc.play();
                                                              > function () {
                                                              > if (this.getDepth()<pic2_mc.getDepth()) {
                                                              > this.swapDepths(pic2_mc);
                                                              > }
                                                              > }

                                                              In the first line, you're telling a movie clip whose instance name is
                                                              pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                              If so, consider the "point of view" of this ActionScript. If you're already
                                                              inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                              are you going to find it? It's interesting to me that you used "this" in
                                                              the function, because "this" refers to the object or timeline it's in.
                                                              Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                              not.

                                                              You can use the trace() function to kind of help you "see under the
                                                              hood." Before you do anything else, you'll have to actually *run* the
                                                              function. You're written one, but you aren't calling it anywhere.

                                                              function test() {
                                                              trace("Hi there");
                                                              }

                                                              On its own, that doesn't do anything. To call this function, type
                                                              test() ... make sense? You don't have to type it right away. In you might,
                                                              for example, call the test() function from inside a button, whenever the
                                                              user gets around to clicking ... or you might call the test() function in a
                                                              later frame of that timeline -- or any other timeline or object that can
                                                              path to the timeline in which the function was written.

                                                              e.g. if the function is written inside clipA, you can call it from the
                                                              main timeline -- assuming clipA is in the main timeline -- like this ...

                                                              clipA.test();

                                                              If this were my project, I'd probably put all the ActionScript in frames
                                                              of the main timeline, rather than inside the clips themselves. Just give
                                                              each clip an instance name and then call each by name from the main
                                                              timeline, telling it what to do -- based on the properties, methods, and
                                                              events described in that object's (in this case, the MovieClip) class.


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


                                                              • 28. Re: Swap MovieClips
                                                                Level 7
                                                                GellyBean,

                                                                > I made a MC with two layers (one 4 actions the
                                                                > other for pictures) The code that I used is this,
                                                                > but it is not working

                                                                > pic1_mc.play();
                                                                > function () {
                                                                > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                > this.swapDepths(pic2_mc);
                                                                > }
                                                                > }

                                                                In the first line, you're telling a movie clip whose instance name is
                                                                pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                If so, consider the "point of view" of this ActionScript. If you're already
                                                                inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                are you going to find it? It's interesting to me that you used "this" in
                                                                the function, because "this" refers to the object or timeline it's in.
                                                                Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                not.

                                                                You can use the trace() function to kind of help you "see under the
                                                                hood." Before you do anything else, you'll have to actually *run* the
                                                                function. You're written one, but you aren't calling it anywhere.

                                                                function test() {
                                                                trace("Hi there");
                                                                }

                                                                On its own, that doesn't do anything. To call this function, type
                                                                test() ... make sense? You don't have to type it right away. In you might,
                                                                for example, call the test() function from inside a button, whenever the
                                                                user gets around to clicking ... or you might call the test() function in a
                                                                later frame of that timeline -- or any other timeline or object that can
                                                                path to the timeline in which the function was written.

                                                                e.g. if the function is written inside clipA, you can call it from the
                                                                main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                clipA.test();

                                                                If this were my project, I'd probably put all the ActionScript in frames
                                                                of the main timeline, rather than inside the clips themselves. Just give
                                                                each clip an instance name and then call each by name from the main
                                                                timeline, telling it what to do -- based on the properties, methods, and
                                                                events described in that object's (in this case, the MovieClip) class.


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


                                                                • 29. Re: Swap MovieClips
                                                                  Level 7
                                                                  GellyBean,

                                                                  > I made a MC with two layers (one 4 actions the
                                                                  > other for pictures) The code that I used is this,
                                                                  > but it is not working

                                                                  > pic1_mc.play();
                                                                  > function () {
                                                                  > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                  > this.swapDepths(pic2_mc);
                                                                  > }
                                                                  > }

                                                                  In the first line, you're telling a movie clip whose instance name is
                                                                  pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                  If so, consider the "point of view" of this ActionScript. If you're already
                                                                  inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                  are you going to find it? It's interesting to me that you used "this" in
                                                                  the function, because "this" refers to the object or timeline it's in.
                                                                  Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                  not.

                                                                  You can use the trace() function to kind of help you "see under the
                                                                  hood." Before you do anything else, you'll have to actually *run* the
                                                                  function. You're written one, but you aren't calling it anywhere.

                                                                  function test() {
                                                                  trace("Hi there");
                                                                  }

                                                                  On its own, that doesn't do anything. To call this function, type
                                                                  test() ... make sense? You don't have to type it right away. In you might,
                                                                  for example, call the test() function from inside a button, whenever the
                                                                  user gets around to clicking ... or you might call the test() function in a
                                                                  later frame of that timeline -- or any other timeline or object that can
                                                                  path to the timeline in which the function was written.

                                                                  e.g. if the function is written inside clipA, you can call it from the
                                                                  main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                  clipA.test();

                                                                  If this were my project, I'd probably put all the ActionScript in frames
                                                                  of the main timeline, rather than inside the clips themselves. Just give
                                                                  each clip an instance name and then call each by name from the main
                                                                  timeline, telling it what to do -- based on the properties, methods, and
                                                                  events described in that object's (in this case, the MovieClip) class.


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


                                                                  • 30. Re: Swap MovieClips
                                                                    Level 7
                                                                    GellyBean,

                                                                    > I made a MC with two layers (one 4 actions the
                                                                    > other for pictures) The code that I used is this,
                                                                    > but it is not working

                                                                    > pic1_mc.play();
                                                                    > function () {
                                                                    > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                    > this.swapDepths(pic2_mc);
                                                                    > }
                                                                    > }

                                                                    In the first line, you're telling a movie clip whose instance name is
                                                                    pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                    If so, consider the "point of view" of this ActionScript. If you're already
                                                                    inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                    are you going to find it? It's interesting to me that you used "this" in
                                                                    the function, because "this" refers to the object or timeline it's in.
                                                                    Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                    not.

                                                                    You can use the trace() function to kind of help you "see under the
                                                                    hood." Before you do anything else, you'll have to actually *run* the
                                                                    function. You're written one, but you aren't calling it anywhere.

                                                                    function test() {
                                                                    trace("Hi there");
                                                                    }

                                                                    On its own, that doesn't do anything. To call this function, type
                                                                    test() ... make sense? You don't have to type it right away. In you might,
                                                                    for example, call the test() function from inside a button, whenever the
                                                                    user gets around to clicking ... or you might call the test() function in a
                                                                    later frame of that timeline -- or any other timeline or object that can
                                                                    path to the timeline in which the function was written.

                                                                    e.g. if the function is written inside clipA, you can call it from the
                                                                    main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                    clipA.test();

                                                                    If this were my project, I'd probably put all the ActionScript in frames
                                                                    of the main timeline, rather than inside the clips themselves. Just give
                                                                    each clip an instance name and then call each by name from the main
                                                                    timeline, telling it what to do -- based on the properties, methods, and
                                                                    events described in that object's (in this case, the MovieClip) class.


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


                                                                    • 31. Re: Swap MovieClips
                                                                      Level 7
                                                                      GellyBean,

                                                                      > I made a MC with two layers (one 4 actions the
                                                                      > other for pictures) The code that I used is this,
                                                                      > but it is not working

                                                                      > pic1_mc.play();
                                                                      > function () {
                                                                      > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                      > this.swapDepths(pic2_mc);
                                                                      > }
                                                                      > }

                                                                      In the first line, you're telling a movie clip whose instance name is
                                                                      pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                      If so, consider the "point of view" of this ActionScript. If you're already
                                                                      inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                      are you going to find it? It's interesting to me that you used "this" in
                                                                      the function, because "this" refers to the object or timeline it's in.
                                                                      Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                      not.

                                                                      You can use the trace() function to kind of help you "see under the
                                                                      hood." Before you do anything else, you'll have to actually *run* the
                                                                      function. You're written one, but you aren't calling it anywhere.

                                                                      function test() {
                                                                      trace("Hi there");
                                                                      }

                                                                      On its own, that doesn't do anything. To call this function, type
                                                                      test() ... make sense? You don't have to type it right away. In you might,
                                                                      for example, call the test() function from inside a button, whenever the
                                                                      user gets around to clicking ... or you might call the test() function in a
                                                                      later frame of that timeline -- or any other timeline or object that can
                                                                      path to the timeline in which the function was written.

                                                                      e.g. if the function is written inside clipA, you can call it from the
                                                                      main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                      clipA.test();

                                                                      If this were my project, I'd probably put all the ActionScript in frames
                                                                      of the main timeline, rather than inside the clips themselves. Just give
                                                                      each clip an instance name and then call each by name from the main
                                                                      timeline, telling it what to do -- based on the properties, methods, and
                                                                      events described in that object's (in this case, the MovieClip) class.


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


                                                                      • 32. Re: Swap MovieClips
                                                                        Level 7
                                                                        GellyBean,

                                                                        > I made a MC with two layers (one 4 actions the
                                                                        > other for pictures) The code that I used is this,
                                                                        > but it is not working

                                                                        > pic1_mc.play();
                                                                        > function () {
                                                                        > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                        > this.swapDepths(pic2_mc);
                                                                        > }
                                                                        > }

                                                                        In the first line, you're telling a movie clip whose instance name is
                                                                        pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                        If so, consider the "point of view" of this ActionScript. If you're already
                                                                        inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                        are you going to find it? It's interesting to me that you used "this" in
                                                                        the function, because "this" refers to the object or timeline it's in.
                                                                        Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                        not.

                                                                        You can use the trace() function to kind of help you "see under the
                                                                        hood." Before you do anything else, you'll have to actually *run* the
                                                                        function. You're written one, but you aren't calling it anywhere.

                                                                        function test() {
                                                                        trace("Hi there");
                                                                        }

                                                                        On its own, that doesn't do anything. To call this function, type
                                                                        test() ... make sense? You don't have to type it right away. In you might,
                                                                        for example, call the test() function from inside a button, whenever the
                                                                        user gets around to clicking ... or you might call the test() function in a
                                                                        later frame of that timeline -- or any other timeline or object that can
                                                                        path to the timeline in which the function was written.

                                                                        e.g. if the function is written inside clipA, you can call it from the
                                                                        main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                        clipA.test();

                                                                        If this were my project, I'd probably put all the ActionScript in frames
                                                                        of the main timeline, rather than inside the clips themselves. Just give
                                                                        each clip an instance name and then call each by name from the main
                                                                        timeline, telling it what to do -- based on the properties, methods, and
                                                                        events described in that object's (in this case, the MovieClip) class.


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


                                                                        • 33. Re: Swap MovieClips
                                                                          Level 7
                                                                          GellyBean,

                                                                          > I made a MC with two layers (one 4 actions the
                                                                          > other for pictures) The code that I used is this,
                                                                          > but it is not working

                                                                          > pic1_mc.play();
                                                                          > function () {
                                                                          > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                          > this.swapDepths(pic2_mc);
                                                                          > }
                                                                          > }

                                                                          In the first line, you're telling a movie clip whose instance name is
                                                                          pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                          If so, consider the "point of view" of this ActionScript. If you're already
                                                                          inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                          are you going to find it? It's interesting to me that you used "this" in
                                                                          the function, because "this" refers to the object or timeline it's in.
                                                                          Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                          not.

                                                                          You can use the trace() function to kind of help you "see under the
                                                                          hood." Before you do anything else, you'll have to actually *run* the
                                                                          function. You're written one, but you aren't calling it anywhere.

                                                                          function test() {
                                                                          trace("Hi there");
                                                                          }

                                                                          On its own, that doesn't do anything. To call this function, type
                                                                          test() ... make sense? You don't have to type it right away. In you might,
                                                                          for example, call the test() function from inside a button, whenever the
                                                                          user gets around to clicking ... or you might call the test() function in a
                                                                          later frame of that timeline -- or any other timeline or object that can
                                                                          path to the timeline in which the function was written.

                                                                          e.g. if the function is written inside clipA, you can call it from the
                                                                          main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                          clipA.test();

                                                                          If this were my project, I'd probably put all the ActionScript in frames
                                                                          of the main timeline, rather than inside the clips themselves. Just give
                                                                          each clip an instance name and then call each by name from the main
                                                                          timeline, telling it what to do -- based on the properties, methods, and
                                                                          events described in that object's (in this case, the MovieClip) class.


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


                                                                          • 34. Re: Swap MovieClips
                                                                            Level 7
                                                                            GellyBean,

                                                                            > I made a MC with two layers (one 4 actions the
                                                                            > other for pictures) The code that I used is this,
                                                                            > but it is not working

                                                                            > pic1_mc.play();
                                                                            > function () {
                                                                            > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                            > this.swapDepths(pic2_mc);
                                                                            > }
                                                                            > }

                                                                            In the first line, you're telling a movie clip whose instance name is
                                                                            pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                            If so, consider the "point of view" of this ActionScript. If you're already
                                                                            inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                            are you going to find it? It's interesting to me that you used "this" in
                                                                            the function, because "this" refers to the object or timeline it's in.
                                                                            Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                            not.

                                                                            You can use the trace() function to kind of help you "see under the
                                                                            hood." Before you do anything else, you'll have to actually *run* the
                                                                            function. You're written one, but you aren't calling it anywhere.

                                                                            function test() {
                                                                            trace("Hi there");
                                                                            }

                                                                            On its own, that doesn't do anything. To call this function, type
                                                                            test() ... make sense? You don't have to type it right away. In you might,
                                                                            for example, call the test() function from inside a button, whenever the
                                                                            user gets around to clicking ... or you might call the test() function in a
                                                                            later frame of that timeline -- or any other timeline or object that can
                                                                            path to the timeline in which the function was written.

                                                                            e.g. if the function is written inside clipA, you can call it from the
                                                                            main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                            clipA.test();

                                                                            If this were my project, I'd probably put all the ActionScript in frames
                                                                            of the main timeline, rather than inside the clips themselves. Just give
                                                                            each clip an instance name and then call each by name from the main
                                                                            timeline, telling it what to do -- based on the properties, methods, and
                                                                            events described in that object's (in this case, the MovieClip) class.


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


                                                                            • 35. Re: Swap MovieClips
                                                                              Level 7
                                                                              GellyBean,

                                                                              > I made a MC with two layers (one 4 actions the
                                                                              > other for pictures) The code that I used is this,
                                                                              > but it is not working

                                                                              > pic1_mc.play();
                                                                              > function () {
                                                                              > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                              > this.swapDepths(pic2_mc);
                                                                              > }
                                                                              > }

                                                                              In the first line, you're telling a movie clip whose instance name is
                                                                              pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                              If so, consider the "point of view" of this ActionScript. If you're already
                                                                              inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                              are you going to find it? It's interesting to me that you used "this" in
                                                                              the function, because "this" refers to the object or timeline it's in.
                                                                              Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                              not.

                                                                              You can use the trace() function to kind of help you "see under the
                                                                              hood." Before you do anything else, you'll have to actually *run* the
                                                                              function. You're written one, but you aren't calling it anywhere.

                                                                              function test() {
                                                                              trace("Hi there");
                                                                              }

                                                                              On its own, that doesn't do anything. To call this function, type
                                                                              test() ... make sense? You don't have to type it right away. In you might,
                                                                              for example, call the test() function from inside a button, whenever the
                                                                              user gets around to clicking ... or you might call the test() function in a
                                                                              later frame of that timeline -- or any other timeline or object that can
                                                                              path to the timeline in which the function was written.

                                                                              e.g. if the function is written inside clipA, you can call it from the
                                                                              main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                              clipA.test();

                                                                              If this were my project, I'd probably put all the ActionScript in frames
                                                                              of the main timeline, rather than inside the clips themselves. Just give
                                                                              each clip an instance name and then call each by name from the main
                                                                              timeline, telling it what to do -- based on the properties, methods, and
                                                                              events described in that object's (in this case, the MovieClip) class.


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


                                                                              • 36. Re: Swap MovieClips
                                                                                Level 7
                                                                                GellyBean,

                                                                                > I made a MC with two layers (one 4 actions the
                                                                                > other for pictures) The code that I used is this,
                                                                                > but it is not working

                                                                                > pic1_mc.play();
                                                                                > function () {
                                                                                > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                                > this.swapDepths(pic2_mc);
                                                                                > }
                                                                                > }

                                                                                In the first line, you're telling a movie clip whose instance name is
                                                                                pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                                If so, consider the "point of view" of this ActionScript. If you're already
                                                                                inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                                are you going to find it? It's interesting to me that you used "this" in
                                                                                the function, because "this" refers to the object or timeline it's in.
                                                                                Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                                not.

                                                                                You can use the trace() function to kind of help you "see under the
                                                                                hood." Before you do anything else, you'll have to actually *run* the
                                                                                function. You're written one, but you aren't calling it anywhere.

                                                                                function test() {
                                                                                trace("Hi there");
                                                                                }

                                                                                On its own, that doesn't do anything. To call this function, type
                                                                                test() ... make sense? You don't have to type it right away. In you might,
                                                                                for example, call the test() function from inside a button, whenever the
                                                                                user gets around to clicking ... or you might call the test() function in a
                                                                                later frame of that timeline -- or any other timeline or object that can
                                                                                path to the timeline in which the function was written.

                                                                                e.g. if the function is written inside clipA, you can call it from the
                                                                                main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                                clipA.test();

                                                                                If this were my project, I'd probably put all the ActionScript in frames
                                                                                of the main timeline, rather than inside the clips themselves. Just give
                                                                                each clip an instance name and then call each by name from the main
                                                                                timeline, telling it what to do -- based on the properties, methods, and
                                                                                events described in that object's (in this case, the MovieClip) class.


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


                                                                                • 37. Re: Swap MovieClips
                                                                                  Level 7
                                                                                  GellyBean,

                                                                                  > I made a MC with two layers (one 4 actions the
                                                                                  > other for pictures) The code that I used is this,
                                                                                  > but it is not working

                                                                                  > pic1_mc.play();
                                                                                  > function () {
                                                                                  > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                                  > this.swapDepths(pic2_mc);
                                                                                  > }
                                                                                  > }

                                                                                  In the first line, you're telling a movie clip whose instance name is
                                                                                  pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                                  If so, consider the "point of view" of this ActionScript. If you're already
                                                                                  inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                                  are you going to find it? It's interesting to me that you used "this" in
                                                                                  the function, because "this" refers to the object or timeline it's in.
                                                                                  Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                                  not.

                                                                                  You can use the trace() function to kind of help you "see under the
                                                                                  hood." Before you do anything else, you'll have to actually *run* the
                                                                                  function. You're written one, but you aren't calling it anywhere.

                                                                                  function test() {
                                                                                  trace("Hi there");
                                                                                  }

                                                                                  On its own, that doesn't do anything. To call this function, type
                                                                                  test() ... make sense? You don't have to type it right away. In you might,
                                                                                  for example, call the test() function from inside a button, whenever the
                                                                                  user gets around to clicking ... or you might call the test() function in a
                                                                                  later frame of that timeline -- or any other timeline or object that can
                                                                                  path to the timeline in which the function was written.

                                                                                  e.g. if the function is written inside clipA, you can call it from the
                                                                                  main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                                  clipA.test();

                                                                                  If this were my project, I'd probably put all the ActionScript in frames
                                                                                  of the main timeline, rather than inside the clips themselves. Just give
                                                                                  each clip an instance name and then call each by name from the main
                                                                                  timeline, telling it what to do -- based on the properties, methods, and
                                                                                  events described in that object's (in this case, the MovieClip) class.


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


                                                                                  • 38. Re: Swap MovieClips
                                                                                    Level 7
                                                                                    GellyBean,

                                                                                    > I made a MC with two layers (one 4 actions the
                                                                                    > other for pictures) The code that I used is this,
                                                                                    > but it is not working

                                                                                    > pic1_mc.play();
                                                                                    > function () {
                                                                                    > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                                    > this.swapDepths(pic2_mc);
                                                                                    > }
                                                                                    > }

                                                                                    In the first line, you're telling a movie clip whose instance name is
                                                                                    pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                                    If so, consider the "point of view" of this ActionScript. If you're already
                                                                                    inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                                    are you going to find it? It's interesting to me that you used "this" in
                                                                                    the function, because "this" refers to the object or timeline it's in.
                                                                                    Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                                    not.

                                                                                    You can use the trace() function to kind of help you "see under the
                                                                                    hood." Before you do anything else, you'll have to actually *run* the
                                                                                    function. You're written one, but you aren't calling it anywhere.

                                                                                    function test() {
                                                                                    trace("Hi there");
                                                                                    }

                                                                                    On its own, that doesn't do anything. To call this function, type
                                                                                    test() ... make sense? You don't have to type it right away. In you might,
                                                                                    for example, call the test() function from inside a button, whenever the
                                                                                    user gets around to clicking ... or you might call the test() function in a
                                                                                    later frame of that timeline -- or any other timeline or object that can
                                                                                    path to the timeline in which the function was written.

                                                                                    e.g. if the function is written inside clipA, you can call it from the
                                                                                    main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                                    clipA.test();

                                                                                    If this were my project, I'd probably put all the ActionScript in frames
                                                                                    of the main timeline, rather than inside the clips themselves. Just give
                                                                                    each clip an instance name and then call each by name from the main
                                                                                    timeline, telling it what to do -- based on the properties, methods, and
                                                                                    events described in that object's (in this case, the MovieClip) class.


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


                                                                                    • 39. Re: Swap MovieClips
                                                                                      Level 7
                                                                                      GellyBean,

                                                                                      > I made a MC with two layers (one 4 actions the
                                                                                      > other for pictures) The code that I used is this,
                                                                                      > but it is not working

                                                                                      > pic1_mc.play();
                                                                                      > function () {
                                                                                      > if (this.getDepth()<pic2_mc.getDepth()) {
                                                                                      > this.swapDepths(pic2_mc);
                                                                                      > }
                                                                                      > }

                                                                                      In the first line, you're telling a movie clip whose instance name is
                                                                                      pic1_mc to play. Where is this code? Is this in the timeline of pic1_mc?
                                                                                      If so, consider the "point of view" of this ActionScript. If you're already
                                                                                      inside pic1_mc, this code is going to look for an object named pic1_mc ...
                                                                                      are you going to find it? It's interesting to me that you used "this" in
                                                                                      the function, because "this" refers to the object or timeline it's in.
                                                                                      Depending on your circumstances, "this" might refers to pic1_mc; it might
                                                                                      not.

                                                                                      You can use the trace() function to kind of help you "see under the
                                                                                      hood." Before you do anything else, you'll have to actually *run* the
                                                                                      function. You're written one, but you aren't calling it anywhere.

                                                                                      function test() {
                                                                                      trace("Hi there");
                                                                                      }

                                                                                      On its own, that doesn't do anything. To call this function, type
                                                                                      test() ... make sense? You don't have to type it right away. In you might,
                                                                                      for example, call the test() function from inside a button, whenever the
                                                                                      user gets around to clicking ... or you might call the test() function in a
                                                                                      later frame of that timeline -- or any other timeline or object that can
                                                                                      path to the timeline in which the function was written.

                                                                                      e.g. if the function is written inside clipA, you can call it from the
                                                                                      main timeline -- assuming clipA is in the main timeline -- like this ...

                                                                                      clipA.test();

                                                                                      If this were my project, I'd probably put all the ActionScript in frames
                                                                                      of the main timeline, rather than inside the clips themselves. Just give
                                                                                      each clip an instance name and then call each by name from the main
                                                                                      timeline, telling it what to do -- based on the properties, methods, and
                                                                                      events described in that object's (in this case, the MovieClip) class.


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


                                                                                      1 2 Previous Next