PDA

View Full Version : [Help] Controller animations stuck on first frame



jcrash
May 7th, 2005, 01:41 PM
Ok, well I'm testing out several platform options at the moment, and quite a few of them have been running into the same kind of bug. Everytime I use a controll key press to make the character move, their animation that its supposed to go to only plays for one frame. I have tried several ways to correct this... gotoAndPlay, gotoAndStop, looped animation, nested animation, nested loop animation etc... it all looks like muppets on ice. Here's a .fla to check out, if you'd like to help. This is based on baukereg's platform prototype. I also have a similar problem w/ Tonypa Tile Based Platform Prototype.

TIA. :dog:

p.s. flash player 7 w/ AS2.

link to .fla (as it is too big to up here): http://www.assassinrecords.net/animatedProblems.fla

Belmont
May 8th, 2005, 01:04 PM
Well I think what it is, is that in your onClipEvent (enterFrame), in else if (con == "ground"), the hero movieclip is sent to "idle" and then checkHorizon() is called sending it to "run" if left or right in down, which of course starts the run animation, but since the onClipEvent send hero back to "idle" at the beginning of every frame, the run animation never gets a chance to get past the first frame.

But if you remove "else { gotoAndStop("idle"); }" on line 103, it seems to work!

Hope that's works for ya!
~Belmont

jcrash
May 8th, 2005, 10:55 PM
mate, it helped a bunch many thanx!

but now I have new problems... one I sort of corrected. he would get stuck in his run animation when no key was pressed, so I put in :

onClipEvent(keyUp){
//37 and 39 are left and right. it didn't work when i put in Key.LEFT or Key.RIGHT, so i used numbers
if(!Key.isDown(37) && !Key.isDown(39) )
this.gotoAndStop("idle");

}

before the main chunk of my ClipEvent (enterFrame) code...

but now sometimes when he dies, he flashes quick to the kill, but gets sent straight back to idle. it happens about 1 in 20 times or so. usually if I hit left and right in quick succession when he gets touched.


I tried to put an additional... && con !== "die"... but that just screwed it up royally.

any insight?

new fla...

http://www.assassinrecords.net/wontDieRight.fla

Belmont
May 9th, 2005, 12:21 AM
Try:

onClipEvent(keyUp){
if(!Key.isDown(37) && !Key.isDown(39) && this._currentframe == 2)
this.gotoAndStop("idle");
}

I wasn't able to get it to happen again after several minutes of messing around... So not 110% sure, but that might do it. =]

jcrash
May 9th, 2005, 05:59 AM
fixed it! word. =)