Page 1 of 1

An Animating Question

PostPosted: Sat Jan 07, 2012 8:39 am
by PurplePanda
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:
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 :shock:. My idea is to create a minigame where crystal has to jump over stuff that the wind is blowing towards her.

Re: An Animating Question

PostPosted: Sun Jan 08, 2012 2:17 am
by BlueLight
Didn't you already show this?

Re: An Animating Question

PostPosted: Mon Jan 09, 2012 4:28 am
by suki888
Nice, keep it up dude ;)

Re: An Animating Question

PostPosted: Mon Jan 09, 2012 4:35 am
by Mr D
you already have the same thread in creatice corner -_- ( viewtopic.php?f=7&t=1925 ). Why post it a second time?

Re: An Animating Question

PostPosted: Mon Jan 09, 2012 1:28 pm
by Lucky777
Pretty sure the "posts awaiting approval" system got him.

Re: An Animating Question

PostPosted: Mon Jan 09, 2012 2:33 pm
by Renara
Gonna lock this since the other thread here (Thanks Mr D) has some great replies already.