SunQuest
 
           Flash Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignFlash Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 2nd, 2007, 01:37 AM
reaper43 reaper43 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 2 reaper43 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 51 sec
Reputation Power: 0
Flash Game

Hi everyone,

I'm creating a simple flash game and I've read TONS of tutorials for the past couple of days, but none of them seem to answer my question.

I have one character, with 5 frames of animation in the movie clip. I would like to know how when you press either up, down, left, right, or go diagonally in any direction, flash plays the animation and the character movies in that direction. However, I also want to make it so that when you release the key, the animation stops at the specific place it was left off, and when you go in the same or another direction, it picks up where it left off.

Any help is appreciated. Thank you!

Reply With Quote
  #2  
Old September 2nd, 2007, 11:17 PM
reaper43 reaper43 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 2 reaper43 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 51 sec
Reputation Power: 0
A little update.

I've got her walking; here's the script I used

Code:
onClipEvent(enterFrame)
{
if(Key.isDown(Key.RIGHT)){
this.gotoAndStop(2);
this._x+=3;
_xscale=100;
}

else if(Key.isDown(Key.LEFT)){
this.gotoAndStop(2);
this._x-=3;
_xscale=-100;
}

else gotoAndStop(1);
}


And I've made a movie clip inside of the person movie clip in frame 2 with her walking animation. This works well; it makes her walk in 2 directions. However, after you release the key, she goes back to her original position, which is not what I want. I want her to stay at the position that she is at.

I think the problem is the
Code:
else gotoAndStop(1);


...but I don't know what to substitute that with?

Reply With Quote
  #3  
Old September 20th, 2007, 06:04 PM
l0g1cDust l0g1cDust is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 1 l0g1cDust User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 18 sec
Reputation Power: 0
Send a message via Google Talk to l0g1cDust
i tried your code and i worked for me

maybe the problem is w/ some other code?

Reply With Quote
  #4  
Old October 22nd, 2007, 10:48 AM
trish trish is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 12 trish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 3 sec
Reputation Power: 0
yeah i also tried...same one here also

Reply With Quote
  #5  
Old January 2nd, 2008, 04:20 PM
Quak Multimedia Quak Multimedia is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Manchester, UK
Posts: 4 Quak Multimedia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 45 sec
Reputation Power: 0
Quote:
Originally Posted by reaper43
A little update.

I've got her walking; here's the script I used

Code:
onClipEvent(enterFrame)
{
if(Key.isDown(Key.RIGHT)){
this.gotoAndStop(2);
this._x+=3;
_xscale=100;
}

else if(Key.isDown(Key.LEFT)){
this.gotoAndStop(2);
this._x-=3;
_xscale=-100;
}

else gotoAndStop(1);
}


And I've made a movie clip inside of the person movie clip in frame 2 with her walking animation. This works well; it makes her walk in 2 directions. However, after you release the key, she goes back to her original position, which is not what I want. I want her to stay at the position that she is at.

I think the problem is the
Code:
else gotoAndStop(1);


...but I don't know what to substitute that with?


With that code, whenever you press a button that is not either Up or Down, she will go to the first frame.

You should just remove that line.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignFlash Development > Flash Game


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway