Archive for the 'ActionScript 2.0' Category

Four Chapter Excerpts from The ActionScript 3.0 Quick Reference Guide

Tuesday, December 23rd, 2008
ActionScript 2.0 ActionScript 3.0 Flash

I just got word from Adobe that a number of The ActionScript 3.0 Quick Reference Guide excerpts are freely available in PDF format from the Developer Connection’s ActionScript Technology Center:  Check ’em out!

Combine those with the freebie excerpts at, and you’ll find you have a decent selection to help you choose if this book would be useful to you.  Keep reading »

Flash Troubleshooter Chronicles

Friday, December 19th, 2008
ActionScript 2.0 Flash

Most of us have at least one mentor, even if it’s someone we haven’t met in person.  In fact, if you’re anything like me, you have a different mentor for each field that interests you:  someone who inspires you to keep practicing the piano, to get creatively crazy in the kitchen, to learn yet another unicycle trick, and to keep strengthening your grasp on Flash (or Photoshop, or Dreamweaver … you get the idea).

When it comes to Flash, one of my mentors has helped me significantly with troubleshooting — with making things work when, against all expectation, they simply don’t work. In a recent four-part series I wrote for, I explored a single theme — troubleshooting — from a variety of angles, sharing with readers what my mentor has shared with me.  Along the way, the series turns up a few quirks involved in working with Flash, but more importantly, it reviews how to approach arriving at useful workarounds, regardless what the issue is.

The first of four articles is free and investigates a puzzling visual issue I encountered while working on a set of custom UI tabs.  (It was originally published back in November, but I didn’t realize at the time it was a freebie!)  The follow-up articles go into other scenarios, and each one stands alone.  Community MX offers free trial memberships, so it’s possible to read all four without cost, in addition to other CMX content.  If you want to subscribe, do — but there’s no obligation.  :)

Creating a Smart Skip Intro Button in Flash

Wednesday, October 15th, 2008
ActionScript 2.0 ActionScript 3.0 Flash

Generally speaking, Flash designers have become more considerate. In the late 1990s, it was common to encounter dozens of Flash websites a day with bloated, pointless intro animations. Ultimately, sure, content was king: users would eventually get to the meat of a website, but all too often, were subjected to unnecessary bells and whistles, simply because Flash was the shiny new kid on the block. Nowadays, bloated intros are largely a thing of the past, but back then, designers were proud of these intros and assumed users were thrilled to see them. Frankly, it just wasn’t so.

Fortunately, designers began to change their ways. Best practices took hold, and the “Skip Intro” button became a fashionable device (in fact, it appeared so often it became an industry joke). If users were really lucky, they’d even see an “Always Skip Intro” button, which remembered their preference for the next visit. In this freebie Community MX tutorial, you’ll learn how to create such a button.

Building Click-and-Rotate Content in Flash

Tuesday, June 24th, 2008
ActionScript 2.0 ActionScript 3.0 Flash

In one implementation of the QuickTime VR format, known as QTVR Object Movies, the user can click-and-drag an image to seemingly rotate it, as if spinning the real-life object on a lazy Susan.  This simulated 3D interactivity can improve multimedia curb appeal, and makes for a nifty way to showcase merchandise.  But it doesn’t stop there:  the same basic principle can also bring click-and-drag responsiveness to short video sequences and even user input widgets, such as the click-and-scrub input fields of numerous Adobe dialog boxes.  Keep reading »

How to Position Dynamically Loaded Content Based on Browser Resizing

Sunday, April 20th, 2008
ActionScript 2.0

In one of the recent comments to “How to Position Movie Clips Based on Browser Resizing,” a look at the ActionScript 2.0 Stage.onResize event, reader Eddy asked about adjusting an image loaded at runtime; particularly, about fading in an image set to scale and reposition itself based on the size of the browser.  I was originally going to reply to his comment directly, but this seems to me like something that would make a decent blog entry of its own, so here’s one particular stab at it.  Keep reading »

New O’Reilly Title, Coming Soon!

Wednesday, March 12th, 2008
ActionScript 2.0 ActionScript 3.0 Flash General

I just finished the last of my eleven chapters for a new O’Reilly title, ActionScript 3.0:  The Quick Answer Guide for Flash Professionals, last Wednesday.  This was shortly after lunch, 12:30 on the dot, and a neat thing happened almost as I lifted my hands from the keyboard (more on that in a sec).  The rest of the book is still being written, and it’s shaping up nicely.  I’m pretty excited about this project already!  :)   The aim of this reference is to help developers, even keyframe coders, get up to speed with AS3, so keep your eyes peeled in June!

I took a wild tumble off the grid while I was researching and writing for the past five or six weeks, so I apologize for my late replies to blog comments and email.  I’ve been catching up on my inbox since last Wednesday and plan to reply to everyone as soon as I can.  Thanks, so much, to my friends for all the encouragement!  (Go,!)

I’ll be going over author reviews in the coming weeks, but the heavy lifting is behind me.  The neat thing that happened, on day I finished, is this:  I went downstairs to gaze out the window for a few moments, and right as I did, UPS brought a package to the door.  I opened the box, and inside was a huge tin of Turkish coffee (over a pound!), imported from Turkey, sent by reader Çağatay.  What a way to commemorate the milestone!  Thanks, Çağatay!  This coffee is a real treat!

How to use Font Symbols (Embedded Fonts) with ActionScript

Thursday, February 28th, 2008
ActionScript 2.0 ActionScript 3.0

You certainly don’t need ActionScript to make use of embedded fonts.  You can always just embed font outlines manually by selecting a text field, then using the Embed button in the Property inspector.  Select your range of characters, type in your text, then publish; you’re good to go (and you only need to do it with dynamic and input text fields:  static text fields embed font outlines automatically).  In fact, if your text field has an instance name — something you can also set in the Property inspector — then you can determine its text content with ActionScript and the embedded font outlines still hold.  But if you’re using ActionScript to create text fields on the fly, the mechanics are a bit different.  Let’s take a look.  Keep reading »

Progressive Enhancement with Flash

Monday, February 4th, 2008
ActionScript 2.0 ActionScript 3.0 Flash

One of the main tenets of good Web design is the principle of progressive enhancement.  In general, the idea goes like this:  make sure the user can access a web site’s essential content regardless of browser.  It shouldn’t matter whether the user visits your site with Internet Explorer, Firefox, Safari, Netscape, or pick your favorite flavor.  In fact, the site’s content should be accessible even without JavaScript or peripheral plugins like Flash Player.  Once the basics are covered, use CSS to enhance the visual design.  Then, and only then, introduce the whizz-bang stuff — nifty rollovers, AJAX interactivity, Flash — and do it in a way that doesn’t penalize users who don’t have (or choose to disable) the needed machinery.

Sound pretty neat?  I’ve seen a few examples of this online and at conferences, so I delved into this topic myself to see how much fun it might be.  Turns out it can be somewhat challenging, but definitely fun to see the results.  I put together an example in order to explore the basic mechanics of this form of progressive enhancement — a slideshow SWF that takes its cue from the HTML in which it appears — and turned it into a three-part series on  The first part is free and covers how to get the HTML from the Web page itself into the SWF.  The follow-up articles go into how to parse that HTML in AS2 and AS3.  CommunityMX offers free trial memberships, so if you aren’t interested in becoming a subscriber, you can wait until the follow-up that interests you gets posted (not sure yet when that will be), then sign up for the trial membership.  Of course, if you want to subscribe, that would be cool too!

Working with asfunction in AS2 Class Files

Tuesday, January 29th, 2008
ActionScript 2.0

Flash Player has supported a limited subset of the HTML specification since version 6 — just set a text field’s htmlText property to an HTML-formatted string and you’re good to go.  Fortunately, <a> (anchor) tags are among the supported few, which means you can even put working hyperlinks inside your text.  Not only that, but Flash includes a special protocol, asfunction, that allows you to trigger functions from those hyperlinks, in case you prefer to do that instead of visiting URLs.  ActionScript 3.0 uses a different approach, but if you’re coding in AS1 or 2, just replace with asfunction:someFunction,someParam, as described elsewhere on this blog.  If you’re coding in timeline keyframes, it’s all pretty straightforward.  But asfunction can seemingly break when used in custom class files.  Here’s what’s going on and how to fix it.  Keep reading »

How to Play a Timeline Backwards (with Easing!)

Wednesday, January 2nd, 2008
ActionScript 2.0 ActionScript 3.0

Reader James Colvin wrote me in mid-December to ask if I had any thoughts on playing a timeline backwards.  As it turns out, this question comes up every now and then on the Adobe forums, where longtime regular kglad usually posts his very handy custom function in reply.  In kglad’s version, the MovieClip.nextFrame() and prevFrame() methods are used in cahoots with setInterval() to accomplish the goal.  He often assigns the function to the Object.prototype property of the MovieClip class, which makes the new functionality available to all movie clips (a pre-AS3 technique).

My initial reaction was to search the forums and send back a link, but James’ question had an interesting twist:  could this non-standard timeline movement include easing?  Wow, what a cool challenge!  So I thought about it off and on over the holidays, and a neat solution occurred to me just this morning.  Keep reading »