Game - Char Problems etc

Hey I’m creating a isometric game that somewhat resembles the “look” of the sims and the storyline of a game such as zelda etc…

Currently I have two problems.

  1. My character is showing motion so I have written this script for it.
onClipEvent (enterFrame) {
	vely = 0;
	velx = 0;
	if (key.isDown(Key.UP)) {
		vely -= 5;
	}
	if (key.isDown(Key.DOWN)) {
		vely += 5;
	}
	if (key.isDown(Key.LEFT)) {
		velx -= 5;
	}
	if (key.isDown(Key.RIGHT)) {
		velx += 5;
		gotoAndPlay ("wRight");
	}
	if (key.isUp(Key.RIGHT)) {
		velx = 0;
		gotoAndPlay ("sRight");
     }
	if (hitCheck(_root.hitBox,0,14)) {
		velx = 0;
		vely = 0;
	}
	_x += velx;
	_y += vely;
}

Basically you know what this script does, if you look closely you’ll see I added

	if (key.isDown(Key.RIGHT)) {
		velx += 5;
		gotoAndPlay ("wRight");
	}
	if (key.isUp(Key.RIGHT)) {
		velx = 0;
		gotoAndPlay ("sRight");
     }

Which when the button is pressed right it plays wRight which is the movie clip of the char walking to the right.
When the key is released it stops the char and updates its picture to the “standing char”.

I’ll tell you what I want to result the i’ll tell you what happens. I want the character to start off in a certain position. Then when the right (and others later on when i code it) button is pressed I want it to play the movie that corresponds with that buttons. I then want the movie to stop the second the button is released and I want the character to stop its movement on the frame that it was released on.

Here is my problem with this, first off the code I have written clearly does not do all the things I wish for it to do I simply do not know how to get it to do those things. As of now the character starts off in a frame with a man facing left. This is just a simple graphic with a stop(); when the key is pressed to the right it does infact play the right move but it plays it even when the button is not pressed (sometimes it works if you do it fast enough) Also when the button is not pressed after being pressed I have the script bring the character back to that single graphic position which looks odd if the character stopped at a different position than the regular graphic.

I hope this makes sense, I’ll stop here and just reply with the other problems later. Thanks