Hello.
Well I am making this ship game right and when You press the left button.
[AS]onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
this._x -= 5;
this.gotoAndPlay(2);
}
}
[/AS]
It will go left and play an animation but see I want the animatyion to work As I press left the animation It only works after I am done pressing it please help me.
system
July 11, 2003, 11:53pm
2
You should know by now that Random is not the place for Flash questions :evil:
system
July 11, 2003, 11:55pm
3
Opps I didnt know I put it in there
system
July 12, 2003, 12:27am
4
just a guess…
if (Key.isDown(Key.LEFT)) {
this._x -= 5;
if (!this.l) this.gotoAndPlay(2);
}
this.l = Key.isDown(Key.LEFT);
??
system
July 12, 2003, 1:11am
5
It WOrks!!!
Questions:
What does ! mean its in the code
and also what does this code do
this.l = Key.isDown(Key.LEFT);
system
July 12, 2003, 1:28am
6
! (logical NOT)
Key.isDown returns a Boolean (true/false), it simply assigns that Boolean to this.l, which will be evaluated by the if action.