Archive

Archive for the ‘Uncategorized’ Category

Final Grades Submitted

June 21st, 2009

Congratulations on complete your first Flash class! Final grades have been submitted and are updated on this blog. Have a great break, see you next term!

Author: admin Categories: Uncategorized Tags:

Tweening with ActionScript 3

June 6th, 2009
Get Adobe Flash player

Dowload the above example here.

Using the Timeline isn’t the only way to animate an Object in Flash. There are several ActionScript Tweening Libraries that you can import and use. Attached is an example of using Tweener to tween the x and y properties of a ball. Notice that the caurina folder is in the same directory and the tweener.fla file. This is so the tweener.fla file can find the Tweener ActionScript files using the caurina.transitions.* package definition.

Here’s how you import tweener:

import caurina.transitions.*;

And to tween parameters of an Object:

Tweener.addTween(ball, {x:0, y:0, transition:"easeOutQuad", time:1, delay:.4});

The first parameter you pass to the addTween method is the instance name of the MovieClip (or DisplayObject) that you want to tween. The second parameter that you pass, is a generic Object that describes what to tween, how long to take for the tween (in seconds), and what type of easing equation to use. The transition property defines the type of easing equations to use, Tweener easing equations can be seen here. There are several optional parameters that you can use to do things like delay a Tween, or call a function before, or after a tween is completed. You can see a full list of Tweener Parameters here.
See the Tweener documentation on Google Code for more on what you can do with Tweener.

Author: admin Categories: Uncategorized Tags:

Timeline Animation in Flash CS 4

June 5th, 2009

Flash CS 4 completely changed the way timeline animation is done. This video is from Adobe TV, and a great example how how to do things the “new” way.

See this video full size here.

Author: admin Categories: Uncategorized Tags:

Remote Controlled Robot

May 13th, 2009

rc_robot

So in class Week 6 we went over how to make a remote controlled robot! Here is the example .fla that I made in class.

Author: admin Categories: Uncategorized Tags: , , ,

Listening to MouseEvents in ActionScript 3

May 3rd, 2009

There are a number of MouseEvents that a MovieClip can listen to. You can see them all at the ActionScript 3.0 Flash Player 9 Language Reference here. The most common is listening to when something is clicked.

To listen for when a MovieClip is clicked, we need to add a listener to the MovieClip, and a assign a function to be called when the event happens. This is where giving your MovieClip an instance name comes into play. You use the instance name that you gave the MovieClip in the Properties Panel to target that MovieClip with ActionScript. In this example, we are targeting the sun_mc MovieClip;

// this gives the movieclip a pointer cursor
sun_mc.buttonMode = sun_mc.useHandCursor = sun_mc.mouseEnabled =  true;
// this adds a listener to the sun, whenever its clicked, the handleMouseUp function is called
sun_mc.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);

// this is the handleMouseUp function
function handleMouseUp(e:MouseEvent) : void {
	// Because its an event handler you can grab a reference to whatever was clicked through the MouseEvent parameter, in this case clicked will always be sun_mc
	var clicked:MovieClip = e.currentTarget as MovieClip;
	// clicked is the same thing as sun_mc, we tell it to go to and play the clicked frame on its timeline
	clicked.gotoAndPlay("clicked");
}

Get the source example files here.

If you have questions feel free to post comments to this blog post or post to the forum.

Author: admin Categories: Uncategorized Tags:

Welcome to WDIM 121

March 25th, 2009

This blog is for the Spring ‘09 WDIM 121 Introduction to Authoring class. Hope you’re all ready for some serious Flash action!

Author: admin Categories: Uncategorized Tags: