Bahamutzero

Hello all you people out there…Im new to post here on this forum. but might i say i have read just about everything in this section because i myself am also programming a game in flash…first one too might i add…thanks to every one here i have learned quite a bit in a matter of hours. i have created a walking charactor. YAY!. but im not perfect and i can not stop him from animating while standing still…i tried all the gotoandplay, gotoandstop and stop commands and just cant seem to get it…if anyone has any info on how to manage without drastically changing my simple code…please inform me…here it is
onClipEvent (load) {
speed = 15;
}
onClipEvent (enterFrame) {
if (key.isdown(key.LEFT)) {
_x -= speed;
_root.snake.gotoAndStop(2);
}
if (key.isdown(key.RIGHT)) {
_x += speed;
_root.snake.gotoAndStop(4);
}
if (key.isdown(key.DOWN)) {
_y += speed;
_root.snake.gotoAndStop(1);
}
if (key.isdown(key.UP)) {
_y -= speed;
_root.snake.gotoAndStop(3);
}
}

go inside the snake movie clip and put a stop(); command on each frame

i tried that and it animated then stoped so he moved while standing still…ill attach the source maybe it would be easier for you to take a look manutally

i am not an expert but i believe i can figure it out for you ill look at your fla when i get home at night

the frames it stops on have movie clips in them… You need to edit the clip containing clip

EDIT: i fixed it for you… one sec

EDIT: **** I SO HAD IT!!!

OKay, here’s the deal… You have 4 frames in the snake movie clip… Each one is a movie clip… This is really annoying me… Take the frames and put ALL of them in one clip…

ugh, tech problems… Anyway… One movie clip please… Even when i had it it wasnt perfect as the anim ahd to play through before the stop.

OKAY… Ill fix it for you… But you will resize these sprites… BARRGH!

This is bugging me, may not be done

sorry …im not sure what you mean…to me the way you described what to do seems as if he would spin in circles while walking…but this could be because i dont know flash yet…heh…

i know what he means. the problem with yours is that you have a movie clip inside a movie clip which is really confusing and probably not the best way to do it. i would suggest you put all the frames in the sub movie clips into the main one and get rid of the sub movie clips, then put stop(); at the end of each action.

i know what he means. the problem with yours is that you have a movie clip inside a movie clip which is really confusing and probably not the best way to do it. i would suggest you put all the frames in the sub movie clips into the main one and get rid of the sub movie clips, then put stop(); at the end of each action. he should not keep on spinning with the stop(); commands.

I think i get it…ill hafta try that…but know ill be back for more help later lol…and thanks alot for helping me on sutch short notice…you guys are great.

just add a 5th keyframe with the stopping animation, then use this AS:


onClipEvent (load) {
	speed = 15;
	
}
onClipEvent (enterFrame) {

	stopping = true;
	if (key.isdown(key.LEFT)) {
		_x -= speed;
		_root.snake.gotoAndStop(2);
		stopping = false;
	}
	if (key.isdown(key.RIGHT)) {
		_x += speed;
		_root.snake.gotoAndStop(4);
		stopping = false;
	}
	if (key.isdown(key.DOWN)) {
		_y += speed;
		_root.snake.gotoAndStop(1);
		stopping = false;
	}
	if (key.isdown(key.UP)) {
		_y -= speed;
		_root.snake.gotoAndStop(3);
		stopping = false;
	}
	if (stopping == true) {
		this.gotoAndStop(5);
	}
}

that works, and that takes me closer to my goal…only problum is i want him to retain his facing position on key release (which he faces whatever way the pic on the frame is)…sorry im a greedy man…lol. i tried making stopping1 - stopping4 and 4 new frames…one for each direction…but that fell through and didnt work…some reason he stopped animating…man…any suggestions?
and as always thanks.