Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Actionscript: The Definitive Guide

Posted by timothy on Sun May 27, 2001 09:15 AM
from the make-it-work-in-lynx dept.
Reader Brian Donovan contributed the review below of O'Reilly & Associates' ActionScript: The Definitive Guide, which he says is a "must have" for anyone working on Web animation with Flash. Offered under the condition that you please not make your site utterly dependent on Flash, of course;)

ActionScript : The Definitive Guide
author Colin Moock
pages 672
publisher O'Reilly & Associates
rating 9
reviewer Brian Donovan
ISBN 1565928520
summary Complete and authoritative. Check the author's site book site (http://www.moock.org/asdg) for sample chapters and code.

What it is, why you'd want it

Actionscript, the programming language that's been supported in the Flash player and authoring environment since Flash version 4, is exhaustively described in a new title in the Definitive Guide series from O'Reilly. Written by widely-recognized web developer Colin Moock (http://www.moock.org) and edited by Bruce Epstein (author of Director in a Nutshell and Lingo in a Nutshell), the book lives up to the hype.

Moock divided Actionscript: the Definitive Guide (A: tDG) into 3 sections. "Actionscript Fundamentals" covers the language itself (variables, the Actionscript datatypes, how to declare and use functions, etc) in a way that's accessible to newbies without boring everyone else. "Applied Actionscript" is shorter and has a more conversational tone, explaining how to externalize your code, the ins-and-outs of making smart clips, using text fields as form fields in your movies, and debugging. The "Language Reference" is basically the Actionscript Dictionary from the Flash 5 Actionscript Reference Guide (ARG, pronounced "arrgghhh," similar to the noise that one inevitably makes when forced to refer to same) on steroids. In fact, it would almost be worth the full price of the complete book all by itself. Code is sprinkled liberally throughout. Included are four appendices (resource urls, a keycodes reference, Flash 4/Flash 5 backwards compatibility advice, and a table listing the differences between Actionscript and Javascript/ECMA-262).

What I liked

Although some constructs present in both Javascript and Actionscript (like the arguments object) that managed to go completely unmentioned in the ARG are discussed, the "Actionscript Fundamentals" section is not a retread of the basics of the ECMA standard. There's a whole chapter on events and event-handling in Flash, including a comprehensive treatment of movie clip events. The chapter on OOP in Actionscript is the first real discussion of object-oriented Actionscript programming that I've seen outside of a few posts to a Flash programming mailing list. The detailed coverage of the stacking order of movies and movie clip instances is priceless -- Figure 13-4, "The complete Flash Player movie clip stack" is the clearest visual representation of movie and movie clip instance stacking available.

In the "Applied Actionscript" part of A: tDG, I got the most mileage from the discussion of the different methods of pulling code out of movies and making it more reusable (import from file, #include, shared libraries, and smart clips). Most of that material was already available in separate tech notes at the Macromedia web site (and, to a lesser extent, in the ARG), but it's great to see it brought together in book form.

When I got to the "Actionscript Language Reference," I did a quick page count. It weighed in at 50 pages lighter than the "Actionscript Dictionary" in the ARG, but manages to be more complete and more useful. This could be due to the fact that the pages in A: tDG are covered with text while the "Actionscript Dictionary" pages sport oversized inner margins and whitespace galore. Code is plentiful here, since the entry for practically every Actionscript object or class includes an example script fragment that is generally longer and more useful than the corresponding snippet (when one even exists) in the ARG. Where it's warranted, bug information is included, identifying specific problems with the implementation of the specific Actionscript element in the Flash 5 Player (pinpointing differences in behavior between builds when differences exist) and suggesting workarounds where possible -- the sort of feature that saves coders mountains of frustration of the "it's 4am and I'm tired?why isn't this working?!" variety.

The bottom line

I would have liked to have seen more space devoted to optimization/performance (somehow, code optimization got lumped in with file size considerations in the "The Bandwidth Profiler" section in Chapter 9: "Debugging"), but if it sounds as though I'm nitpicking here, it's because I am. For anyone working with Flash who is interested in taking off the training wheels and developing in "expert mode," this book is a must-have."


You can purchase this book at Fatbrain.

This discussion has been archived. No new comments can be posted.
Actionscript: The Definitive Guide | Log In/Create an Account | Top | 76 comments (Spill at 50!) | Index Only | Search Discussion
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1) | 2
  • Re:thanks for the example by Anonymous Coward (Score:1) Sunday May 27 2001, @05:38PM
  • by Anonymous Coward on Sunday May 27 2001, @05:38AM (#195567)
    The Flash format (SWF) [openswf.org] IS an open standard.
  • Re:Flash is a dead end by Trepidity (Score:2) Sunday May 27 2001, @12:24PM
  • Re:uses for FLASH that DOn't SUCK !!! by Lord of Caustic Soda (Score:1) Sunday May 27 2001, @12:35PM
  • Re:Fight Death Penalty by Nicolas MONNET (Score:1) Sunday May 27 2001, @10:24AM
  • Flash is love. by Gray (Score:1) Sunday May 27 2001, @09:47AM
  • Flash is a front end by Phil Wilkins (Score:1) Sunday May 27 2001, @01:02PM
  • Re:SVG! by HRbnjR (Score:1) Sunday May 27 2001, @04:42PM
  • SVG! by HRbnjR (Score:2) Sunday May 27 2001, @09:19AM
  • phone book flash by cpeterso (Score:2) Sunday May 27 2001, @08:46AM
  • Re:Flash can be useful by Black Parrot (Score:1) Sunday May 27 2001, @11:57AM
  • Re:A flaw in your reasoning by glutton (Score:1) Sunday May 27 2001, @07:08AM
  • Re:A flaw in your reasoning by glutton (Score:1) Sunday May 27 2001, @07:31AM
  • Re:thanks for the example by kubrick (Score:1) Sunday May 27 2001, @08:26AM
  • Re:Flash is a dead end by kubrick (Score:1) Sunday May 27 2001, @08:31AM
  • Re:physics vs. other stuff by Baloo Ursidae (Score:1) Wednesday June 06 2001, @06:29PM
  • buzzwords, Re:physics vs. other stuff by mefus (Score:1) Sunday May 27 2001, @07:48AM
  • Re:buzzwords, Re:physics vs. other stuff by mefus (Score:1) Sunday May 27 2001, @11:06AM
  • Re:uses for FLASH that DOn't SUCK !!! by TheInternet (Score:1) Sunday May 27 2001, @11:43AM
  • Re:Anti-Art == Annoying by TheInternet (Score:2) Sunday May 27 2001, @11:40AM
  • whoa, chill out, ho. by Digital_Fiend (Score:1) Sunday May 27 2001, @11:35AM
  • Re:SVG! by darylp (Score:1) Sunday May 27 2001, @11:10AM
  • Re:phone book flash by Shanep (Score:1) Wednesday May 30 2001, @09:58AM
  • Re:A flaw in your reasoning by Emil Brink (Score:1) Sunday May 27 2001, @08:58AM
  • Lack of security an issue by PGillingwater (Score:2) Sunday May 27 2001, @08:08AM
  • Mod parent up! Informative! [nt] by moZer (Score:1) Sunday May 27 2001, @05:58AM
  • Flash is a dead end by AirLace (Score:2) Sunday May 27 2001, @05:25AM
  • A flaw in your reasoning by AirLace (Score:2) Sunday May 27 2001, @06:29AM
  • Re:uses for FLASH that DOn't SUCK !!! by isaac_akira (Score:2) Sunday May 27 2001, @07:34PM
  • by fhwang (90412) on Sunday May 27 2001, @08:03AM (#195595) Homepage
    Yes, almost all the Flash out there is worthless, time-wasting eye candy. (The best argument of this is Jakob Nielsen's Alertbox column "Flash: 99% bad" [useit.com].) There's a lot of untapped use, though.

    I have a friend who does a lot of hardcore Flash work. (He's apparently enough of an expert that some folks asked him to narrate an instructional video on the subject.) He's convinced that Flash can do what client-side Java was once pushed for: Highly specialized UIs for specialized goals, using more fine-grained control than you can get through HTML.

    I would be unconvinced, except I had seen something he had done: It was a site that let users design their own Nokia cellphone faceplate. It was a basic painting program using a faceplate-shaped painting surface, and then you could save your design and order it. The Flash app was integrated with an industrial painting machine, which would actually spray out a copy of your faceplate, and then you'd get it in the mail in a few weeks.

    Flash is so commonly misused that it's easy to assume it's an entirely worthless technology. But in the right hands, it seems like it can be very useful.

  • [hackernetwork.com]
    Kung Fu Fighting in Flash

  • Flash vs. Java by gjt (Score:1) Sunday May 27 2001, @10:04AM
  • Re:Flash is a dead end by marcell (Score:1) Sunday May 27 2001, @12:54PM
  • Re:SVG! by wevah (Score:1) Sunday May 27 2001, @10:20PM
  • Re:Widespread use of flash by MrBlack (Score:1) Sunday May 27 2001, @02:18PM
  • Re:Widespread use of flash by MrBlack (Score:1) Thursday May 31 2001, @08:11AM
  • Flash 5 has extensive printing support by phossie (Score:1) Tuesday May 29 2001, @02:46PM
  • Re:Flash is a dead end by phossie (Score:1) Tuesday May 29 2001, @03:00PM
  • It's rare. by Animats (Score:2) Sunday May 27 2001, @10:18AM
  • yes, there is a GPLd flash plugin by StandardDeviant (Score:2) Sunday May 27 2001, @08:49AM
  • Re:It's not because you can, that you should by MousePotato (Score:2) Sunday May 27 2001, @08:03AM
  • User expectation by fleener (Score:2) Sunday May 27 2001, @07:34AM
  • Re:phone book flash by veddermatic (Score:1) Sunday May 27 2001, @01:47PM
  • Re:Flash vs. Java by veddermatic (Score:1) Sunday May 27 2001, @01:52PM
  • Re:thanks for the example by veddermatic (Score:1) Sunday May 27 2001, @01:54PM
  • by veddermatic (143964) on Sunday May 27 2001, @06:03AM (#195611) Homepage
    HUh?

    The Flash file format is open.... go write some perl that can generate Flash files and go nuts bundling... oh wait, someone already did write open source perl that can generate Flash files.

    I have seen some really bad ugly animated GIFs. We should not use the GIF98a format EVER, since you can make ugly, useless things with it. Heck, I've people use the BLINK tag and design really ugly HTML pages... we should get rid of that too!

    Yes, Flash makes it easy for any idiot to make really bad, annoying sites. Then again, FrontPage, Dreamweaver, and GoLive do the same for HTML.

    Good Flash can be an expressive design media, bring animation to the Web (try doing an animated cartoon with sound in GIF89a =) and with Flash 5, can lead to very powerful web-based apps that interact with live data form a variety of sources... check this thing I did for the intranet of my last job:

    http://www.eskimospy.com/contentPages/phone.html [eskimospy.com]

    It's Flash that pulls XML data from the company database (tho this "public" version uses a flat file with fake data) and generates this on the fly, telling you who's in the office with the colored desks and where people sit... this whole thing took me less than one day to design and code, and was live less than 12 hours after I thought of the idea. Sure, You could do it in Java (but in less than 12 hours?) or DHTML (with 4 code-bases and 11209771207 hours of testing in every browser on every OS to make sure it works) but this was easy to make, and even the Linux crew in the programming dept. are happily using it today.

    Is Flash over-used and usually poorly done? Yes. Should Flash be blamed for people not having a clue how to use it? Nope. Don't shoot the tool, shoot the people who use it when they shouldn't be.

    Have a nice day.

    PS: This is a site I love that I think expresses your frustration perfectly: Skip Intro [skipintro.com]

  • Need for a book? by silhouette (Score:1) Sunday May 27 2001, @08:38AM
  • by duvel (173522) on Sunday May 27 2001, @06:08AM (#195613) Homepage
    Although Flash is undoubtedly an interesting implementation to get an end-user solution for not-too-static websites, I'd really appreciate it if all how-to's of this kind of technology would spend the half of their pages in explaining

    why this shouldn't be used too much

    that forcing a surfer through an entry-tunnel to access a website is Bad Practice (tm)

    and that most sites are actually being visited for their content, rather than their flashy look (no pun intended)

    A very interesting point of view on this subject can be found in Phillip Greenspun's Guide to web publishing [arsdigita.com]. Phillip even practices what he preaches on photo.net [photo.net].

  • Re:thanks for the example by pressman (Score:1) Sunday May 27 2001, @07:50AM
  • Re:Flash == Annoying by pressman (Score:1) Sunday May 27 2001, @03:50PM
  • Re:thanks for the example by WildBeast (Score:1) Sunday May 27 2001, @08:10AM
  • Re:thanks for the example by WildBeast (Score:2) Sunday May 27 2001, @06:38AM
  • Re:Why flash ? Opensource alternative ! by core10k (Score:1) Sunday May 27 2001, @05:42AM
  • Mod down Flash flames, mod up book comments by mblase (Score:2) Sunday May 27 2001, @06:29PM
  • Re:thanks for the example by karma kameleon (Score:1) Sunday May 27 2001, @09:41AM
  • Re:Flash detection javascript by roxeteer (Score:1) Sunday May 27 2001, @09:39PM
  • Flash up or down? by ishrat (Score:1) Sunday May 27 2001, @05:57AM
  • Re:Widespread use of flash by DaBB (Score:1) Tuesday May 29 2001, @12:43AM
  • Flash == Annoying by man_ls (Score:1) Sunday May 27 2001, @09:59AM
  • Re:Flash is a dead end by metalhed77 (Score:1) Sunday May 27 2001, @05:34AM
  • Re:physics vs. other stuff by rfsayre (Score:1) Sunday May 27 2001, @06:44AM
  • Re:buzzwords, Re:physics vs. other stuff by rfsayre (Score:1) Sunday May 27 2001, @10:12AM
  • Re:buzzwords, Re:physics vs. other stuff by rfsayre (Score:1) Sunday May 27 2001, @12:17PM
  • physics vs. other stuff by rfsayre (Score:2) Sunday May 27 2001, @06:02AM
  • Widespread use of flash by oooga (Score:1) Sunday May 27 2001, @06:10AM
  • There is a great PHP extension to build SWF too. by fasanima (Score:1) Sunday May 27 2001, @05:10PM
  • Re:Flash is a dead end by ONU CS Geek (Score:1) Sunday May 27 2001, @08:11AM
  • Re:A flaw in your reasoning by janpod66 (Score:2) Sunday May 27 2001, @07:21AM
  • Re:Flash vs. Java by janpod66 (Score:2) Sunday May 27 2001, @02:09PM
  • by janpod66 (323734) on Sunday May 27 2001, @06:27AM (#195635)
    Don't forget that Flash is taking over a lot of territory from Java applets rather than HTML. Which would you rather have?

    Java, without question. Java has a real GUI toolkit that behaves in ways people expect of GUI toolkits. Flash is all about looks, but usability of user interfaces written in Flash leaves a lot to be desired. From a programming point of view, I also prefer Java: it's not as easy as Flash programming, but ultimately, it's more powerful and you can do a lot more in Java.

    But, yes, Macromedia very much would like to take over the applet space with their product. And by providing something that looks spiffy and is easy to get started with, they may well succeed, no matter how many corners they cut.

  • by janpod66 (323734) on Sunday May 27 2001, @06:20AM (#195636)
    with Flash 5, can lead to very powerful web-based apps that interact with live data form a variety of sources... check this thing I did for the intranet of my last job:

    Let's see, when I go to that site, it says "Loading and parsing XML... please be patient." and then it just sits there. There is no error message and now way of figuring out what's wrong.

    When I open it in IE5, I do indeed get some kind of nifty looking display, something that would look swell on a set for StarTrek or The Matrix. Trouble is, it isn't very useful. It ignores my font preferences, so fonts are way too small for my display. The scrollbars don't look like scrollbars. The whole thing doesn't resize. I can't print it. And instead of responding instantly when I click somewhere, it animates. Let's not even talk about accessibility for people with disabilities. In fact, I have seen a number of sites that attempt to use Flash as some kind of "responsive" and "interactive" UI, and they all share the same problems.

    So, thanks for the example: you have provided an excellent example of why Flash is a bad standard to use for writing web-based applications. You presumably invested a lot of time in building this thing, but while it looks nice, what you wrote ends up being considerable less useful and less user friendly than straight HTML and images.

  • uses for FLASH that DOn't SUCK !!! by beanerspace (Score:1) Sunday May 27 2001, @08:16AM
  • Irony alert! by MarkusQ (Score:1) Sunday May 27 2001, @09:18AM
  • Re:Flash can be useful by C. Tengo Hambre (Score:1) Monday May 28 2001, @11:26PM
  • Re:Flash is a dead end by cyphgenic (Score:1) Monday May 28 2001, @01:34AM
  • Flash on da web... by AEngel (Score:1) Monday May 28 2001, @07:22AM
(1) | 2