Web Design, Web Development

Web Design, Web Development

Flash example
   Share/Save    Printer-friendly version   Send to friend   PDF version
Printer-friendly version  

By using Tweener class, it is easy to create a flash animation

Tweener is a static class - that is, a class that allows you to run methods on it, or call its properties, but that never lets you create instances from it. This means that, with Tweener, you never create a new object - you simply tells Tweener to do something for you.

Download the Tweener class? Click here
   Share/Save    Printer-friendly version   Send to friend   PDF version
Printer-friendly version  

Why create your own ActionScript 3.0 class?

Using your own classes, you can make programming easier, organize your ActionScript, group related functionality together, and hide details when you don't need to see them.

How to create your own ActionScript 3.0 class?

Suppose the directory of your application is like that:
/Test.fla
/Test.as
/com/FlashExample/MyClass.as
The "Test.as" is an ActionScript 3 document class, and the "MyClass.as" is your own class.

   Share/Save    Printer-friendly version   Send to friend   PDF version
Printer-friendly version  

Create three movieclips for clock hand: hour, minute, and second.

The important thing is that you need to move the center registration point of each hand to the axis of the hand (probably one end), so that the movie clip will rotate around that point.

Attach these movieclips to stage.

Press Ctrl+L, then drop and draw these m
   Share/Save    Printer-friendly version   Send to friend   PDF version

Why use document class?

In Actionscript 3, we suggest you remove all codes from the Timeline and specific instance. Instead of that, we should write our codes in a document class. With a document class, you get to write pure object-oriented code in your class, which can work with all the other classes within the project scope, as well as exported items in your library or named instances sitting on the stage in your .fla.

Syndicate content