|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
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? |
|
#3
|
|||
|
|||
|
i tried your code and i worked for me
maybe the problem is w/ some other code? |
|
#4
|
|||
|
|||
|
yeah i also tried...same one here also
|
|
#5
|
|||
|
|||
|
Quote:
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. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Flash Development > Flash Game |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|