Forums

ForumsProgramming Forum

Game in the works

Posted Jul 18, '14 at 7:51pm

weirdlike

weirdlike

889 posts

Moderator

Well looking at the code is limited when the question is directed at the animation. I am speculating that you might need to look at the frames in the clip that has the delay. First make a copy of it then you can try removing the first frame. If it is exactly the same as clip before it. Then it makes sense that it will show the same frame (and appear to have slight lag) then continue through the timeline. If you notice that it is making a difference then you can play around with the animation and find the exact frame to start from.

 

Posted Jul 18, '14 at 10:38pm

Fortheseen

Fortheseen

12 posts

Okay, I'll mess around with the frames and see what's going on with them. Thanks for the help again.

 

Posted Jul 20, '14 at 7:36pm

Fortheseen

Fortheseen

12 posts

Would the cause of the problem be if I am using the same picture on multiple frames?

 

Posted Jul 20, '14 at 8:14pm

weirdlike

weirdlike

889 posts

Moderator

It could very well be it. When you hero.gotoAndStop("jumping"); and there is a slight lag but only at the beginning then it might not be a lag at all, and it is the start of the sequence. Remove the frames (after you make a copy) that are at the beginning until it is smooth.

 

Posted Jul 20, '14 at 8:33pm

Fortheseen

Fortheseen

12 posts

Is there a command or something to completely stop the previous animation? While the other animation is running?


last edited Jul 20 2014 08:34 pm by Fortheseen
 

Posted Jul 20, '14 at 9:06pm

weirdlike

weirdlike

889 posts

Moderator

It is to my understanding when you switch frames the MovieClip on the previous frame ends and when you switch back it starts over. Anywho... The hero movie clip is on the stage. So the stage is the parent and hero is the child (unless you addChild on some other layer or it is not already present on stage). The hero (if you double click on the clip) also contains children; running, jumping, and sliding. You can select these children and give them instance names. If the jumping clip was declared as jumpingMC then you could use hero.jumpingMC.stop(); or hero.jumpingMC.gotoAndStop(1);. If you create a hero class you would eliminate the hero bit all together and it would look like this jumpingMC.gotoAndStop(1); If you decide to take this route you might also need to use hero.jumpingMC.play();

 

Posted Jul 20, '14 at 9:26pm

Fortheseen

Fortheseen

12 posts

Okay, thanks.

 

Posted Jul 20, '14 at 11:25pm

Fortheseen

Fortheseen

12 posts

Hey, sorry to bother you again but I am trying to add in a start button and I want to change scenes after I click on it. This is the code I have for my button:

import flash.events.MouseEvent;

Object(this).start.addEventListener(MouseEvent.CLICK, goStart);

function goStart(event:MouseEvent):void {
gotoAndStop(2, "Scene 2");
}

I am not sure why it won't go to the second scene.

 

Posted Jul 20, '14 at 11:30pm

Fortheseen

Fortheseen

12 posts

Actually never mind I figured it out, lol... I guess I do have another question I noticed when I change scenes I have to click on the game box again to start moving my character is that normal when someone does that?


last edited Jul 20 2014 11:31 pm by Fortheseen
 

Posted Jul 21, '14 at 12:25am

weirdlike

weirdlike

889 posts

Moderator

It has to do with the focus, like if there was a text box that entered the name for high scores you can take control by using focus, but for focusing on the game you use this

stage.stageFocusRect = false;
stage.focus = YOURGAMEHERE;

 
Reply to Game in the works

You must be logged in to post a reply!