Be a Supporter!

Intermediate AS Problem

  • 351 Views
  • 6 Replies
New Topic Respond to this Topic
PirateSensei
PirateSensei
  • Member since: Dec. 16, 2004
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Intermediate AS Problem 2006-06-02 06:09:11 Reply

Okay, my little character in my game has two frames: Standing and Still.
Each frame has a movieclip of my character doing said thing.
Here is a portion of the script:

if (Key.isDown(Key.RIGHT)) {
this._x += speed;
this.gotoAndStop(2);
_xscale = +scale;
}

and

onClipEvent (keyUp) {
this.gotoAndStop(1);
}

however, there is a problem. Occasionally but not always, when I let go of the movement keys she keeps walking on the spot.
I've had three years experience with Flash so there's no need to dumb it down for me.
Thanks in advance!

PirateSensei
PirateSensei
  • Member since: Dec. 16, 2004
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to Intermediate AS Problem 2006-06-02 06:27:13 Reply

I hate bumping as much as the next person, but the forum just ATE my thread.

LostVoices
LostVoices
  • Member since: Mar. 9, 2006
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Intermediate AS Problem 2006-06-02 06:53:43 Reply

dont know if it will help but try putting the gotoAndStop(2) or whatever it is first in the if statement before the movement command


awww

PirateSensei
PirateSensei
  • Member since: Dec. 16, 2004
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to Intermediate AS Problem 2006-06-02 06:56:54 Reply

Didn't work.
Thanks anyway.

Max-Pain
Max-Pain
  • Member since: Jul. 7, 2004
  • Offline.
Forum Stats
Member
Level 34
Blank Slate
Response to Intermediate AS Problem 2006-06-02 07:14:40 Reply

Try this:

In the end of the "walking movie clip" put the script:

_root.mc.gotoAndStop(1);

mc = character...

PirateSensei
PirateSensei
  • Member since: Dec. 16, 2004
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to Intermediate AS Problem 2006-06-02 07:20:26 Reply

Nope... :(

Ghoul-5
Ghoul-5
  • Member since: Jul. 31, 2005
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Intermediate AS Problem 2006-06-02 07:51:22 Reply

I had the same problem in my abandonned game.

I think i did managed to solve it by making a variable "moving" and if it is 0 the character MC goes to idle, if it is 1 it goes to moving animation.

and then i made an Actionscript that sets movement to 1 if the key is pressed, and sets it back to 0 otherwise.

Though i'm not sure if this was the way i did it, i abandonned that project some time ago, because i wasn't able to fix some other errors, and i don't remember, neither can i find it..


THE CAKE IS A LIE