ActionScript: Flash Buttons with Style

In today's article, Allan shows you how to abstract all the parameters for his flash button into Actionscript, making a generic function that allows the Flash button to be controlled programmatically from outside Flash.

This 13 page article is suitable for beginners and intermediate Actionscripters and Dreamweaver users who wish to enhance the interactivity and look of buttons by using Flash.

- OR -


Table of Content:

  • The core button
  • Altering last week's button
  • Creating the button from scratch
  • ActionScript concepts
  • Making it all dynamic
  • Creating the Movie clip
  • Giving the button some more to do
  • The root timeline
  • The code itself
    • Variables for testing
    • Building our own functions
    • Starting the animation
    • Stopping the animation
    • Creating the animThing Object
    • The animThing.startup() function
    • The animThing.doAnim function
    • The animThing.grow function
    • Adding more animations
  • Putting it all together



Allan Kent

Allan KentAllan comes from Cape Town, South Africa. He has been implicated in writing for several WROX, glasshaus, Wiley and Apress publications, generally in the 'cool stuff that PHP can do' sections.

You can catch up with him at his website

See All Postings From Allan Kent >>


Not so great...

August 14, 2003 by Shawn Kelshaw

I am a intermediate level flash developer and thought this would be a good tutorial. After purchase, I went through the .pdf and attempted to execute. However, it seems this tutorial may rely a little too much on a previous tutorial and code. The explanation are a little shady and I get error's when I attempt to test:

(i.e. scene="Scene" 1, layer="Layer" 4, frame="1": Line 8: Left side of assignment operator must be variable or property.
     _root.doAnim() = function(){)

I thought maybe this error occurred because I am using Flash MX and this tutorial was written for an earlier version of Flash. When I went back to DMXzone to verify, that information is nowhere to be found. Any reference to a version of Flash relating to this article simply reads Flash.

Is it me or did I waist $2.00?

RE: Not so great...

August 18, 2003 by Shawn Kelshaw

Alan. I apologize. I should have caught that myself. Anyway, thanks for your attention to it and I checked the site. The site instructions are correct too. I will post an amendment to my first review soon.



Everyone, I screwed up. This tutorial is GREAT! Give it a try. But don't do like me and add a set of "()" before your first function. IT WON'T WORK!


Bye. shawn.

RE: RE: Not so great...

August 18, 2003 by Allan Kent

Shawn,  I just checked and we can in future provide a download link for the source files used in the article.  This will help avoid confusion about where code blocks need to go and what the code is exactly.


Agree that link is needed.

February 27, 2004 by George Zirfas
I agree that providing a link for the source files is needed. Because flash allows you to add actions almost anywhere, to frames, movie clips etc., it's easy to put your scripts somewhere they don't belong. Which either makes them not execute or execute with errors. I had trouble with the tutorial and consider myself at least an intermediate user.

You must me logged in to write a review.