View Full Version : Ok so i need help with this one
ok..
now i have an walking animation when my char moves so like
when i press left my character moves left but the animation doesnt play.
does anyone know how to fix this problem?
(its tweened if you guys wanna know)
bactac
06-18-2005, 01:52 PM
put a stop() in the first frame of mc
so when u press left you put play() and _xscale= -100
i dont get it....-_-
EDIT:
see i already got the moving going on but when i press and hold left
the script was like gotoandplay(2); but what happens is that the animation doesnt go on it just does the first frame oh i also want it to loop the same animation(since he's walkin) and when the player stops holding the left button it goes back to frame one.(where the normal mc looks like)
here's my code for the mc
if (Key.isDown(65) == true) {
_x = _x-5;//that is for moving, no problem with that
gotoandplay(2);//that is for the looping walking animation
}else{//if not holding the button thingy
gotoandstop(1);//it will go to its original form
by the way, dont worry about closing tags and clipevents, ive got them workin properly..unless you can put them if you really really want to
xion71
06-18-2005, 03:43 PM
I think the problem is that ur saying Thingy
I know how to help, but I wont coz youre a noob and too lazy to search... IN YOURE FACE!
u never can take a joke can u? lol
The Brown Cow
06-18-2005, 04:07 PM
Yeesh.... All of you little jerks get outta the Flash Dev forum, okay? If you don't know the answer and you're not going to help, don't post.
Alright, common mistake. Problem is that you're running the script every frame the button is held down, so the timeline is sent to the second frame every frame. Since it's always on the second frame, it won't play the next frame and animate.
What I'd do is put the walking animation in another movieclip, and place it on the second frame of the character clip. Then you can replace the gotoAndPlay() with a gotoAndStop(). The timeline will stay on the second frame, but the clip is on the second frame, and will animate.
it only works for 1 movement i've got tons of movements
onClipEvent (enterFrame) {
original_x = _x;
original_y = _y;
if (Key.isDown(65) == true) {
_x = _x-5;
}
if (Key.isDown(68) == true) {
_x = _x+5;
}
if (Key.isDown(87) == true) {
_y = _y-5;
}
if (Key.isDown(83) == true) {
_y = _y+5;
}
}
EDIT:its overhead view game, and im using the same animation for walking
-ive attached the game swf-
tatorhead
06-18-2005, 11:57 PM
yeah since you're using my code, I'll let you know that the
original_x = _x;
original_y = _y;
part of the code is useless, It used to do hittests, but I took that off in the version of the my .fla you stole
i didnt actually steal it, you held it up for public-which ment anyone could get it.
u never can take a joke can u? lol
That was realy too insulting to be a joke :P
Urg, i didnt read TBC's post but i think hes written pretty much the same thing as im about to,
im only going to tell you how to do it in one direction
so you have a walking animation within your mc, highlight them all except the first frame of the walking anim, right click, copy frames, delete the frames. Remeber the frame i told you to leave out click it (you need to name it "walk" ctrl+f3 then change name), convert whatever is on that frame into a MovieClip (f8) now right click, paste frames. They wont be in the right place, theyll be about 250 pixels in the wrong direction (dont you just love flash) anyway click the edit multiple frames button:
http://img294.echo.cx/img294/8001/editmultipleframes9zo.jpg
two circles should appear above your frames (in the timeline) like when using onion skin, drag them along the frames you want, press ctrl+a to select everything, move it to the desired position. (press enter to see the animation)
now for the actionscript :( within the if statement of the key that moves it in the direction you want type:
this.gotoAndStop ("walk")
http://img265.echo.cx/my.php?image=gamenew6lv.swf
its a side view, its still the same method though.
Thats the basics of it, you need to do a small bit of extra coding that asks flash (if statement) if the key is still being press in the last frame of your animation.
O, and one other thing stop bloody argueing.
bro...u saved this project, thanks
no problem... guessing you got it then? i had trouble with it when i first did a walk cycle thats why i helped so much :P
vBulletin® v3.7.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.