You are browsing the ActionScript 2.0 Category

AS2 Presentation Template v2

( July 29th, 2008 )

I recently completed some presentation work and have subsequently created a much better template for those of you who want to save time getting started with a presentation project.

(This file will open in Flash 8 and Flash CS3)
Get Source


AS2 XML Scrollbar Class

( July 22nd, 2008 )

A very big thank you to Valentino Tombesi for his fantastic Scrollbar Class.

In my efforts to build a simple Flash content management system, I wanted to create a much more dynamic version of his file. Something I could update server-side in an XML file. I actually only changed the way the text fields and data are created at runtime. I also added HTML formatting support. No changes were made to the ScrollBar.as ActionScript. I did, however, change some instance names to english for better understanding.

To better understand the use of XML with Flash, particularly the use of the CDATA node in my XML file, read the very useful Introduction to XML in Flash at kirupa.com

So here is the XML version of the Scrollbar Class:

(This file will open in Flash 8 and Flash CS3) (Preview File)
Get Source


AS2 Load The Next Screen After The Current Screen Has Animated Out

( May 8th, 2008 )

This is extremely useful to understand. It was one of the first bits of complex code I wrote. Here is the scenario:

When a menu button is pressed, you want the current screen to animate out first before loading the next screen. The problem is, once the current screen has animated out, how does Flash know which screen to load? Well, here’s the solution.

(This file will open in Flash 8 and Flash CS3) (Preview File)
Get Source


AS2 Attach A Movie Clip From The Library And Then Remove It

( May 8th, 2008 )

This is a very simple file. It will show you how to dynamically add a Movie Clip from the library at runtime and then remove it from the stage when a button is pressed.

(This file will open in Flash 8 and Flash CS3) (Preview File)
Get Source


AS2 Random Frame

( May 4th, 2008 )

This file goes to a random frame on your Movie Clip’s timeline every specified number of seconds. This is useful with slideshows displaying random images or advertising banners displaying random ads.

(This file will open in Flash 8 and Flash CS3) (Preview File)
Get Source


AS2 Random Falling Objects

( May 4th, 2008 )

This is a useful file which displays falling objects. The number and type of object, speed, rotation and alpha can all be adjusted. The type of motion can also be adjusted to display objects falling straight down or in a snow-like motion. It can also be set to react to the mouse’s movement.

(This file will open in Flash 8 and Flash CS3) (Preview File)
Get Source


AS2 Fullscreen Flash, Not Scaled, Always Centered

( May 1st, 2008 )

I have found this very useful. This will show you how to run your Flash file at 100% of the browser window’s size. If you resize the browser window, the content of the Flash file will always remain at its original scale and centered in the window.

(This file will open in Flash 8 and Flash CS3)
Get Source


AS2 Presentation Template

( March 26th, 2008 )

This is a useful presentation template you can use in your business. It allows for both keyboard and mouse control.

(This file will open in Flash 8 and Flash CS3)
Get Source


AS2 Color Cycler

( March 26th, 2008 )

A simple bit of code which cycles through an array of tints on a MovieClip. This can be useful when you want your background color to smoothly change after a specified number of seconds.

(This file will open in Flash 8 and Flash CS3) (Preview File)
Get Source


AS2 setInterval Example

( January 29th, 2008 )

A very useful menu system, using onRollout delays. This will allow you to separate the menu from the button opening it, as well as place spaces between menu buttons.

(This file will open in Flash 8 and Flash CS3) (Preview File)
Get Source