An Animating Question
Posted: Sat Jan 07, 2012 8:39 am
I've been a long time lurker on these forums and this is my first post. I've been loving all the amazing work thats been done by people like Geopet and thought it was about time I tried my hand at Flash. I've never worked in flash before but I managed to figure a lot out. I've been working on a scene and was wondering how to add an animation that I have created to Krystal. I understand that if I double click the krystal sprite it shows the four frames that are the basic walk and idle animations. I have in my library a jump animation but am not sure how to add it. I tried adding two more animation frames where the walk and idle animations are and added some code. This is the code I have on my Krystal:
I have little programming experience and have never worked with actionscript before, but I assummed that the gotoAndStop(6); and gotoAndStop(5); would access the two frames I added to krystals animation slots. But for some reason instead when you press space she just glides backwards. Anyways thanks for the help and here is the crappy little scene I've built, not much but I tried to make it windy . My idea is to create a minigame where crystal has to jump over stuff that the wind is blowing towards her.
- Code: Select All Code
onClipEvent(enterFrame) {
if(_root.movement or _root.movementright) {
if(Key.isDown(Key.RIGHT)) {
_x += _root.movespeed;
right = true;
gotoAndStop(2);
} else if(right)
gotoAndStop(1);
}
if (_root.movement or _root.movementleft) {
if(Key.isDown(Key.LEFT)) {
_x -= _root.movespeed;
right = false;
gotoAndStop(4);
} else if(!right)
gotoAndStop(3);
}
if (_root.movement or _root.movementleft) {
if(Key.isDown(Key.SPACE)) {
_x -= _root.movespeed;
right = false;
gotoAndStop(6);
} else if(!right)
gotoAndStop(5);
}
}
I have little programming experience and have never worked with actionscript before, but I assummed that the gotoAndStop(6); and gotoAndStop(5); would access the two frames I added to krystals animation slots. But for some reason instead when you press space she just glides backwards. Anyways thanks for the help and here is the crappy little scene I've built, not much but I tried to make it windy . My idea is to create a minigame where crystal has to jump over stuff that the wind is blowing towards her.