AS: moving a character
- lan00
-
lan00
- Member since: May. 20, 2005
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
ok i have this actionscript for my moving guy:
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this.gotoAndStop(2);
_x -= -10;
} else if (!Key.isDown(Key.RIGHT)) {
this.gotoAndStop(1);
}
}
but you see if i do that and add this:
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
this.gotoAndStop(3);
_x -= -10;
} else if (!Key.isDown(Key.LEFTT)) {
this.gotoAndStop(1);
}
}
to the moveclip guy aswell the whole thing stuffs up eg
i want a moving link when you push left it shows a moving animation of link
then when you release the left button it will show the stoped animation of link that is what i want but i cant seem to get it can som1 help me please!
- O3Dstudios
-
O3Dstudios
- Member since: Jan. 4, 2005
- Offline.
-
- Forum Stats
- Member
- Level 08
- Blank Slate
- Inglor
-
Inglor
- Member since: Jan. 26, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (10,869)
- Block
-
- Forum Stats
- Member
- Level 17
- Blank Slate
YOU DON'T PUT AS: IN FRONT OF YOUR THREAD UNLESS IT IS A TUTORIAL ABOUT THE SUBJECT OF THAT THREAD
just make the frames inside the player movieclips themselves and animate those movieclips
- lan00
-
lan00
- Member since: May. 20, 2005
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
just make the frames inside the player movieclips themselves and animate those movieclips
yeah i have done that but i want the action script saying when left is pushed play frame 2 (walking link left)
then when left is release play frame 1 (standing link)
- Inglor
-
Inglor
- Member since: Jan. 26, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (10,869)
- Block
-
- Forum Stats
- Member
- Level 17
- Blank Slate
then the error is the fact you have two T 's in the else if
why not just do:
if (Key.isDown(Key.LEFT)) {
this.gotoAndStop(3);
_x -= -10;
} else {
this.gotoAndStop(1);
}
}
- lan00
-
lan00
- Member since: May. 20, 2005
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
*sigh*
that is not a prob that waz a typo i cant seem to have 2 else actions in the 1 movie clip
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this.gotoAndStop(2);
_x -= -10;
}else if (Key.isDown(Key.LEFT)) {
this.gotoAndStop(3);
_x -= -10;
}else{
this.gotoAndStop(1);
}
}
- lan00
-
lan00
- Member since: May. 20, 2005
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
- DarthRaver
-
DarthRaver
- Member since: Oct. 6, 2004
- Offline.
-
- Forum Stats
- Member
- Level 15
- Blank Slate
if (Key.isDown(Key.RIGHT)) {
this.gotoAndStop(2);
_x -= -10;
}else if (Key.isDown(Key.LEFT)) {
this.gotoAndStop(3);
_x -= -10;
You forgot to change (key.LEFT)) from "_x-= -10;" it should be "_x-= 10;" no negative infront of the ten


