The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 1:57 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 1 post ] 
Character Movement Adobe Flash CS4 [AS3]? 
Author Message

Joined: Fri Feb 03, 2012 3:55 pm
Posts: 1
Gender: Anime Girl
Ok so if you could please help me on this flash fighting game I am working on for a school project It would be greatly appreciated. So here is my dilemma, I'm working on my character's (Ken from streetfighter) movement and how keydown commands effect him. I have created separate movieclips of each animation. 8 in total. Each has multiple frames. I have also created a basic outline for the code:

var Key:KeyObject = new KeyObject(stage);

stage.addEventListener(Event.ENTER_FRAME, onenter);

function onenter(e:Event):void{

if (Key.isDown(Key.RIGHT)) {
Ken.x+=5;
Ken.scaleX=1;
Ken.gotoAndStop('KenWalk');
}else if (Key.isDown(Key.LEFT)) {
Ken.x+=-5;
Ken.scaleX=-1;
Ken.gotoAndStop('KenWalk');
}else{
Ken.gotoAndStop('Ken');
}
}

But I'm not sure how to make the gotoAndStop commands work with animations more than one frame long. If you could just tell me how to fix this I would be so happy. :D
If it makes it easier I'll post an attachment of my .fla file so you can see what I'm talking about. I'm not asking for a full tutorial on how to make the fighting game just how to make my character (Ken) do his walking animation when I press Left or Right. Also for his other animations.
Oh...Well it seems I can't add .fla files :(
Can you still help?


Sun May 20, 2012 7:45 pm
Display posts from previous:  Sort by  
 [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.