Animating The Robot

To animate the Robot I first needed to create a new Movie Clip with all of the Robots body parts in, this was so that I could play around with them within the movie clip and then the animation would be saved in there, I used a very useful and common technique of motion tweening which basically creates the animation of the character moving by analysing where you have moved the body parts to in each keyframe, this therefore creates a smooth animation, as shown below:

Frame 1



Frame 30



As you can see the body was moved up and when the motion tween is applied it will fill all of the empty frames between frame 1 and 30 with the different stages of the animation, to make this animation seem more realistic, I used the ease in/out feature which basically slows things down more realistically when coming to a halt as opposed to stopping suddenly, this is a good feature of Flash and came in very handy with my animations.

There is some ActionScript in this Animation scene also which basically controls the animation of the Grow that I made for the Robot, there is a GO button and a STOP button and these are simple to make as they only require a short amount of code as shown below:

stop_bt.addEventListener(MouseEvent.CLICK, onStopClick, false, 0, true);
grow_bt.addEventListener(MouseEvent.CLICK, onPlayClick, false, 0, true);

function onStopClick(evt:MouseEvent):void {
growbody_mc.stop();
}
function onPlayClick(evt:MouseEvent):void {
growbody_mc.play();
}


As can be seen the "grow_bt" button was linked to making the "growbody_mc" Movie Clip play and the "stop_bt" was linked to making the animation stop, this is good for controlling the different movie clip animations that you could include in a larger scale file.

No comments:

Post a Comment