A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Arrow/character next to...

  1. #1
    Junior Member
    Join Date
    Apr 2004
    Posts
    23

    Arrow/character next to...

    How do i make a character like this megaman thing to move down or up when i hit the down arrow key? And when i hit enter make him fire the blast type thing?

    http://uploads.ungrounded.net/conten...=0&w=470&h=400

  2. #2
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    here would be a good start ..
    http://www.kirupa.com/developer/mx/fire.htm
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

  3. #3
    Junior Member
    Join Date
    Apr 2004
    Posts
    23
    Well that covers the selecting button thing, but not how I get the character to follow the keys i press


  4. #4
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    Code:
    onEnterFrame = function () {
    	if (Key.isDown(Key.LEFT)) {
    		_root.my_mc._x -= 5;
    	} else if (Key.isDown(Key.RIGHT)) {
    		_root.my_mc._x += 5;
    	} else if (Key.isDown(Key.UP)) {
    		_root.my_mc._y -= 5;
    	} else if (Key.isDown(Key.DOWN)) {
    		_root.my_mc._y += 5;
    	}
    };
    my_mc. is the object you want ot move on the stage (instancename)
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

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