Basic actionscript3.0 help needed

Discussion in 'OT Technology' started by Disguy, May 29, 2008.

  1. Disguy

    Disguy Batman > Moon Knight OT Supporter

    Joined:
    Oct 26, 2004
    Messages:
    1,060
    Likes Received:
    0
    I've been trying to do some simple animation. I want to see a ball move from the top of the screen. I've done this with tweens but not code. My goal is to move the ball from the top of the screen to the bottom and back AND view this happening.

    while(ball_mc.y < 300)
    {
    ball_mc.y++;
    }
    trace ("Y = 300");
    trace (ball_mc.y);
    if (ball_mc.y == 300)
    {
    while (ball_mc.y > 0);
    {
    ball_mc.y--;
    }
    trace ("Y = Zero");
    trace (ball_mc.y);
    }

    It does what I want but I don't see it. I'm assuming this has something to do with the several "scenes" or "frames" at the top. This is all in one frame's actionscript.

    I've tried using internet tutorials, youtubes and I'm just confused!

    What am I missing?

    Cliffs: Move a ball, see it move, no tweens.
     
  2. critter783

    critter783 OT Supporter

    Joined:
    Jul 15, 2005
    Messages:
    1,785
    Likes Received:
    0
    Its because you're doing it in one frame. Animation is defined as the transition between keyframes. You could also create a movie object and have the movie object start playing when the frame plays.
     
  3. Disguy

    Disguy Batman > Moon Knight OT Supporter

    Joined:
    Oct 26, 2004
    Messages:
    1,060
    Likes Received:
    0
    I have the ball as a movie clip and it does move. Its all happening in one frame.

    How do I display these animations.
     
  4. critter783

    critter783 OT Supporter

    Joined:
    Jul 15, 2005
    Messages:
    1,785
    Likes Received:
    0
    You play the movie clip at the start of the frame.
     
  5. Disguy

    Disguy Batman > Moon Knight OT Supporter

    Joined:
    Oct 26, 2004
    Messages:
    1,060
    Likes Received:
    0
    play(); does nothing.

    can you be more specific as to what i'm supposed to be doing.
     

Share This Page