A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: move mc from left to right or vice versa

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    22
    Can somebody help me on this :

    I want a mc to continuously move from right to left. When user clicks right button, it should move right and if left is clicked mc should move left. when no button is pressed mc should move from right to left in a loop. My mc width is 5206 ( yes it is 5206 only)

    Grateful for help on this

    hkhyd

  2. #2
    Senior Member Flamboyant Flasher's Avatar
    Join Date
    Dec 2001
    Posts
    1,253
    WHOA...ur width is over five thou? that's crazy...if I recall right, and without referring to my books, the flash stage and off stage area is not that wide put together, so there's a prob right there...

    In any event, to move an MC right to left, add these codes

    On frame 1:

    endStageX = 550;
    if (instancename._x<endStageX) {
    instancename._x += 10;
    } else {
    instancename._x = 0;
    }

    On frame 2:

    gotoAndPlay(1)

    This code will move the MC right to left and have it loop...you can change the values...thus, you can end your stage anywhere you want...and change the 10 value to move it how many pixels you want at a time...

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