+ Reply to Thread
Results 1 to 1 of 1

Thread: [Flash]Move a MovieClip using arrow keys.

  1. #1
    satheesh's Avatar
    satheesh is offline x10 Elder satheesh is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Tamil Nadu,India
    Posts
    883

    Smile [Flash]Move a MovieClip using arrow keys.

    [Flash]Move a MovieClip using arrow keys.
    • Create a Movie Clip and Create a Rectangle or your design in the Movie Clip.
    • Come Back to Scene 1.
    • Select the Movie Clip and set them instance name = “movie”.
    • Select the first Frame.
    • Press F9 and Copy Code Below and paste it.
    Code:
    setInterval(function () {
                  if (Key.isDown(Key.RIGHT)) {
                              setDirection(0);
                              _root.movie._x += 3;
                  }
                  if (Key.isDown(Key.LEFT)) {
                              setDirection(1);
                              _root.movie._x -= 3;
                  }
                  if (Key.isDown(Key.DOWN)) {
                              _root.movie._y += 3;
                  }
                  if (Key.isDown(Key.UP)) {
                              _root.movie._y -= 3;
                  }
                  updateAfterEvent();
      }, 10);
    Good Luck.

    Example:http://svprm.x10hosting.com/for_forums/move.swf
    Last edited by satheesh; 09-28-2007 at 11:43 AM.
    I want to buy Some Scripts So Please Click This link:http://affiliate.tufat.com/index.php?id=4384
    Please rate my site:Click here




+ Reply to Thread

Similar Threads

  1. Arrow Keys or WASD?
    By cyberxzt in forum Off Topic
    Replies: 15
    Last Post: 08-08-2006, 09:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers