Welcome, Guest
  • Author Topic: very simple motion question  (Read 823 times)

    Algreco

    • Seasoned Programmer
    • ***
    • Posts: 123
    • If it 'aint workin blame Flash!
      • View Profile
      • Line Dezine
      • Email
    very simple motion question
    « on: 08/01/04, 05:45 »
    Sorry to even post this.

    I want to move a movie clip from x = 0 to x = 500, then to x = 20 and finally to x = 600.
    how do i do it?
    my script at the moment (is wring) is:

    //clip stands already on x = 0//

    if (this._x >=500){//sending it to x = 500
    targetx = 0;// it bounces back to x = 0
    }
    if (this._x <= 20)){//but on the way it meets x = 20
    targetx = 600;//so it runs towards x = 600
    }

    Sorry for this silly question ;)
    I think I need to use either variables by setting the limitations as true and false or do something with "do while", or "switch" with cases or something, but i'm a little stuck here....
    I actually would be happy if the boundries could be defined with a variable cause I would like to call on a masking effect once the movie clip reaches the appropriate point.
    help? ???
    « Last Edit: 08/01/04, 05:55 by Algreco »

    Mattias Robo

    • Moderator
    • Systems Administrator
    • *****
    • Posts: 555
      • View Profile
      • nook
    Re:very simple motion question
    « Reply #1 on: 08/02/04, 07:02 »

    [script]
    switch (this._x) {
       case 0:
          targetx = 500;
          break;
       case 20:
          targetx = 600;
          break;
       case 500:
          targetx = 20;
          break;
       case 600:
          targetx = 0;
    }
    [/script]
         "I've figured it out. It's not the fords... it's what's IN them!.."

    Algreco

    • Seasoned Programmer
    • ***
    • Posts: 123
    • If it 'aint workin blame Flash!
      • View Profile
      • Line Dezine
      • Email
    Re:very simple motion question
    « Reply #2 on: 08/03/04, 06:09 »
    thnx Mattias, that's what i was after.
    regards,
    Al