Flash Notes: Simple Button Group With Tweener

July 10th, 2008

This example builds on the previous button group example — essentially a group of buttons that have a “disabled” state indicating which button was clicked last, and some animation effects courtesy of Tweener.

Read more...

Flash Notes: Simple Button Group

June 30th, 2008

After getting one button to work, you can get several to work together, in what’s called a “button group.” This is a pretty common UI situation where you have several buttons but each has a “disabled” state indicating it was the last one the user clicked on. The button stays in this state until the user clicks on another button. As an added feature, the instance name of the last button clicked appears on the Stage.

Read more...

Flash Notes: Setting Up An External Class File

May 20th, 2008

Here’s how to create a external class using ActionScript 3. In AS2, I was already familiar with instances of objects in the library. Defining a class is basically the same thing.

Why would you want to do this? In a sense, this is where AS3 as an object oriented programming language has finally been realized. You can create a class (object) with its own properties, completely self-contained in an external AS file, making it portable across .fla files. You could code the class so it “draws itself” (not as I have done below) so it wouldn’t even require a symbol in the library to attach to. But I’ll keep this example simple to communicate the concept.

Read more...

Flash Notes: Preloader

May 19th, 2008

Here’s how to create a preloader in ActionScript 3. The AS2 methods have been thrown out and the new model uses event listeners.

“loaderInfo” is the general state of the SWF as it’s loaded. While it’s loading, you get a progress event, and upon completion, a complete event. Here’s some sample code:

Read more...

Flash Notes: Setting Up An External ActionScript File

May 18th, 2008

Continuing on from the simple button example you can set up an external ActionScript file that contains all your code.

This is setting up a “document class”. You first create an ActionScript file and save it in the same directory as your Flash file; it will have the extension .as. Then go into your Flash file and in the Properties Inspector in the field “Document class”, enter the name of your ActionScript file. Don’t include the extension “.as”. If you did this correctly, when you click on the pencil icon, your external ActionScript file will open.

Read more...