1 Reply Latest reply on Aug 14, 2006 4:01 PM by crazyjoemilan

    Make object fall when released?

    VaporAction
      I want an object (ElementFe_mc) to fall to a table top (_y = 412.4) when released.
      I thought this would be simple, but have been frustrated...here's what I've tried...
        • 1. Make object fall when released?
          crazyjoemilan Level 2
          if you're trying to create an effect of an object falling, you can go about this another way. Here's how I would do it...

          Make a new movieclip, and call the instance helpys_mc. Make four keyframes

          -1-
          stop();
          -2-
          var InitialYPlacement = ElementFe_mc._y
          var fallDistance = 412.4 - InitialYPlacement / 10 //the number 10 is how many steps it will take to fall.
          -3-
          //nothin, unless you make it a bit more fun.
          -4-
          ElementFe_mc._y = InitialYPlacement + fallDistance
          if (ElementFe_mc._y >= 412.4) {
          this.gotoAndStop(1);
          }
          else {
          gotoAndPlay(3)
          }

          now on the button's AS, write:

          onRelease() {
          this.helpys_mc.gotoAndPlay(2);
          }


          To create a much more effective falling effect, you can simulate the object speeding up as it goes along. (this can be done a number of ways).

          Maybe I answered the wrong question, but I hope this helps :)