A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Stop movement when reached position

  1. #1
    Senior Member
    Join Date
    Mar 2002
    Posts
    229

    Stop movement when reached position

    I have code that moves a movie from right to left: -

    xStep = 3;
    yStep = 3;

    char._x = char._x - xStep;

    How can I make this stop moving at a particular x, y coordinate?

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Location
    Jerusalem, Isreal
    Posts
    254

    with a simple "if" condition

    just put an "if" condition that checks if the MC has reached the _x you want it to, and when it does reset xStep and yStep to zero (0).
    i guess you are using a loop to keep the MC moving, so the condition should go in that loop checking each the position each time.
    got me?
    if you need the exact code.. let me know
    Matti Bar-Zeev,
    scriptaholic.

  3. #3
    Senior Member
    Join Date
    Mar 2002
    Posts
    229

    Can I have the code?

    Please can you give me the code, I am kinda struggling

    Thanks

  4. #4
    Senior Member
    Join Date
    Nov 2000
    Location
    Jerusalem, Isreal
    Posts
    254

    well... first things first.

    can you post your code here, or tell me the kind of loop (or event handler) that you are using in order to move the MC?
    good... thatwill give me a hint of how to approch this.
    bye
    Matti Bar-Zeev,
    scriptaholic.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center