PDA

View Full Version : Dumbest or weirdest problem



GexetGuy
January 30th, 2009, 11:57 PM
I have an MC, man. on the man MC i have a script that says


onClipEvent (enterFrame) {
if (Key.isDown(Key.SHIFT)){
this.gotoAndStop(4);
}
if ((Key.isDown(Key.SHIFT)) and (Key.isDown(68))) {
this.gotoAndStop(6);

}
if ((Key.isDown(Key.SHIFT)) and (Key.isDown(65))) {
this.gotoAndStop(6);

}
}
The man's 6th frame has another MC with a walk cycle with a gun. The MC has about 12 frames. The first frame has nothing but script (gotoAndPlay, not gotoAndStop) directing it to another frame (9) in the walk cycle (which looks closest to the stop animation). The last frame plays the walk cycle from the start. There are no stop();'s in any frame or on any movie clip on the 9th frame, but the MC will go to the 9th frame and stop. So yeah, it seems a really stupid problem but i have no clue what is causing it.

And if anyone wants to solve the problem where the man won't shoot to the left, go for it.

http://kyleosite.com/helipod2.fla

is too big for this site's limits...

GexetGuy
January 30th, 2009, 11:58 PM
A funny thing is if i make it



onClipEvent (enterFrame) {
if (Key.isDown(Key.SHIFT)){
this.gotoAndStop(6);
}
if ((Key.isDown(Key.SHIFT)) and (Key.isDown(68))) {
this.gotoAndStop(6);

}
if ((Key.isDown(Key.SHIFT)) and (Key.isDown(65))) {
this.gotoAndStop(6);

}
}


it will play properly...

tapioca
January 31st, 2009, 01:34 PM
uhm, that's a really confusing way of doing things... i personally would use key listeners and move the gotoAndPlay from the frame in the animation into the onKeyDown event... do you want it to stop whenever they press a key and start whenever they release it, then stop again when it's pressed? that's what your current code does from the looks of it...