PDA

View Full Version : Problem!


soulbaren1
06-22-2006, 09:46 PM
AGGHHHH whenever I want to make a character move its fine untill i take my finger off the button which i assigned the movement to but when I do the extra bit of the walking clip keeps going for instance I made a movie clip of a guy walking and then i put stop(); in the action script of the first frame of the movie clip. on the main scene where I have the MC i gave my guy the codes to move. ok now when he is walking cause im holding the button down and then when i stop pushing the button the rest of the movieclip plays till it gets back to frame one how do i make it stop when nothing is being pressed

Freddy
06-23-2006, 08:37 AM
simple. Have it so when the key is down, it goes to the next frame.

if(Key.isDown(Key.RIGHT)){
_root.char.nextFrame();
}
you'll have to edit that to fit your game of course.

But now when the key is down, the movie clip will go to the next frame. When its not down, nothing happens. Thuis keeping it at the last frame it was in. =]

soulbaren1
06-24-2006, 01:24 AM
Doesnt matter anymore i have a diffrent code
onClipEvent (keyUp) {
this.gotoAndStop(1);
}
but ur code would be good for something else im working on thank you