3 Replies Latest reply on Jul 5, 2006 12:15 PM by Newsgroup_User

    create multiple baloons rising using as

    Level 7
      I have a �wipe� that is a bunch of balloons rising across the stage,
      leaving a message, image, whatever, after they are done. I can do this
      at author time using instances of a balloon_mc (to allow minor �jiggle�
      of each baloon), varying their color and creating individual motion
      tweens. It lacks natural randomness, but what the heck, it works. I
      want to do this using actionscript.

      If I use these basic assumptions and steps:

      balloons
      should only be in 5 or 6 colors
      create a color array and randomly select one for each instance
      should start below the stage and float past it
      randomly select starting _x, values within a given range, and
      _y values to stageheight +1
      randomly select ending _x values within a few points either
      side of their start point.

      attach a baloon_mc instance at start_x, and start_y
      color it
      move it to end_x, end_y

      Before I start researching and coding, does anyone have any suggestions?

      Thanks,

      Bill
        • 1. create multiple baloons rising using as
          _bigmac
          I think you'd be further ahead to just assign random motion increments rather than figuring out the math to get them to a specified end point. IE: each balloon gets a random x-increment of, say, -10 to 10 and a random y-increment of 10 to 15. Then, each frame they just step from their current position based on their increments. No math involved in getting them to a preset target endpoint.

          You may also want to give each balloon a preset starting location on/below the stage. By allowing them to randomly choose their own starting _x coord, you risk having them get all bunched up and look ugly. But with preset starts, you can get a nice random animation while still having a consistent overall appearance of the balloons spread *fairly* evenly across the stage.
          • 2. create multiple baloons rising using as
            _bigmac Level 1
            whoops. I posted my reply twice =P
            • 3. Re: create multiple baloons rising using as
              Level 7
              _bigmac wrote:
              > I think you'd be further ahead to just assign random motion increments rather
              > than figuring out the math to get them to a specified end point. IE: each
              > ballon gets a random x-increment of, say, -10 to 10 and a random y-increment of
              > 10 to 15. Then, each frame they just step from their current position based on
              > their increments. No math involved in getting them to a preset target endpoint.
              >
              > You may also want to give each ballon a preset starting location on/below the
              > stage. By allowing them to randomly choose their own starting _x coord, you
              > risk having them get all bunched up and look ugly. But with preset starts, you
              > can get a nice random animation while still having a consistent overall
              > appearance of the balloons spread *fairly* evenly across the stage.
              >

              I understand what you say about a fixed start point, I originally
              thought that as well.

              I'm not sure I follow about random x/y-increment.

              If i start with a _y below the stage, and progressively decrement it,
              the balloon will "rise" until (_y +_height) < 0. In order to prevent a
              perfectly straight rise, end_y shouldn't = start_y, but randomly
              incrementing, or decrementing around start_y, seems to add horizontal
              jumpiness. I hadn't thought about how I would plot from start_y to
              end_y, proportional to rise, but it seems calculation is inevitable?