Welcome to the companion website for Learning ActionScript 3.0 (O’Reilly). Ideally, you have found your way here after acquiring a copy of the book, and you are looking for further information about material referenced therein. If you’re new to this site, please continue reading. If you are a veteran to these pages, thanks for coming back, and have fun exploring.
In addition to including examples specifically cited in the book, we plan to continue to supplement the material with additional examples, new topics of discussion, added resources, and, more.
In the meantime, please check out what’s already here, including the digital forward by Richard Galvan (Flash Product Manager), book source code downloads, and chapter-based quizzes, all found in pages accessible via the sidebar. Also keep an eye out for new and coming posts that expand on chapter content, and more.
Print This Post



(125 votes, average: 3.83 out of 5) 



Thank you for getting the site up, I have been reading the book - which is one of the best flash books I’ve read and have been wanting to try a lot of the exercises without much luck. Im looking forward to what comes of this site!
@Jake:
Thanks very much. We hope you enjoy the book and site. There’s a lot more to come, and the site will continue to improve over time. Notably, there will soon be a forum in which you may find answers from me, Zevan, or other readers. We welcome your suggestions.
Hi Rich,
Just wanted to say thank you for writing the book that I think every designer in the world will want to get there hands on. (I hope there is sequeal to this book, perhaps flash remoting….as there seems to be alot of confusion out there about the future of remoting/AMFPHP etc. Also perhaps a beginners book on how to set up an Ecommerce flash website and what is the best back end program for the job? Is it PHP? etc……Just an idea.
I’ve read alot of actionscript books, and have found it difficult understanding them.(Sometimes I would read the same paragraph four times, until it made sense.)
I’ve been waiting for this book all my life!
I really do believe that this book and Colin Moocks Essential Actionscript 3 is all you really need to do the job.
Thanks again,
from Sydney,Australia
Bought the book today and began reading it. Really looking forward to using. However, I’m a designer and new to actionscript and programming. You wrote twice that this book assumes “a very basic understanding of general scripting concepts.” Don’t have that per se so do you have a recommendation for where I can pick this up either a book or on the web? I determined to learn this but I don’t want to hinder my ability right from the start.
Thanks for any suggestions and this site,
Stephen
@Vlado: Thanks very much for your kind words. They really mean a lot to us! We really tried to write the book you described, and I’m thrilled to hear we struck a chord with you.
@Stephen: Welcome. You ask a very good question. Because you already have this book, I would try jumping right in. I know what you mean about hindering your start but, if things begin to slow down, you can look for additional support at any time. Also, you’ll be back to this book soon, so it will feel familiar when you return. I think you’ll be surprised at how quickly you’ll get up to speed.
We included the disclaimer you mentioned because our page count limit prevented us from starting at the very, very beginning. To be honest, however, it was really in response to the resounding chorus of students who felt let down in the past by more advanced books claiming to be right for every beginner. You may find that our caveat is not even necessary.
I would start with the second chapter to see how that content reads. You don’t have to skip Chapter 1, of course, as it is a big-picture look atw ActionScript 3, but don’t concern yourself with classes right away. Chapter 2 doesn’t exactly start from the very first idea of writing a script, or discuss the Flash interface at length, but it’s a short overview of basic programming building blocks. If you’re comfortable with that, I would then move on to looking at as much of the source code as you can, beginning with Chapter 3, getting you used to properties, methods, and events. There’s no substitute for trial and error.
If you find you want additional support, there are two places to start. The first approach is to use a Flash application text or video training title that only touches lightly on ActionScript. The idea is that those kinds of resources are trying to introduce ActionScript from the standpoint of the Flash interface, rather than trying to cover a wide range of AS topics. If this is appealing, I’ve recorded an intro title for Lynda.com called Flash CS3 Professional Essential Training.
The second approach pushes you to focus on programming from the beginning. Of two common schools of thought, one advocates a simple universal language. Since ActionScript is based on the ECMAScript standard, you can pick up a beginner’s book on JavaScript, for example. I’ve added one to the Buy page if you’re interested. Much will translate to ActionScript, and you will end up with a fundamental understanding of browser scripting as well. However, you’ll be learning syntax specific to a web browser as you go, forcing yourself to keep one foot in the browser and one foot in Flash. Because AS basics are the same as JS basics, I’d suggest staying with AS if you can. Stick with this book, perhaps combined with basic tutorials that are scattered throughout the web. I don’t know of one perfect repository of such tutorials (a good idea for a post for this site, no?), but Kirupa.com is a good place to start.
The other programming school of thought is that you should jump into the deep end right away and focus on computer science best practices, using classes from the beginning, so you don’t have to transition from procedural to object-oriented programming later on. I think this approach is fine for someone that is already oriented in that direction but the overwhelming majority of students that I’ve taught–especially designers–do not typically fair well with this method. That’s actually why we wrote this book. The other down side of this method is that, unless you start with ActionScript (bringing you back to this book), you’ll have to adjust to differences between the language you choose (such as Java) and ActionScript when you’re ready to return to Flash.
I realize I haven’t given you a clear path to follow, but I hope this gives you enough to evaluate a choice or two. I think, as a designer, you’re best option will be to start with this book to see if you already have what you need, or perhaps augment the book with a video training series or generic (as in not AS-specific) Flash text. You can also suggest topics for future posts in this blog and we’ll try to help.
Good luck!
Rich
This just what I needed. The two other topics for addition to the site you mentioned, sources found on the web 1) repositories of introductory programming tutorials and 2) computer science best practices, would be a very helpful supplement to beginners since the book has space limitations.
So I’m going for plan A, dive right in. Your comment of taking a passing “concern” with the classes is helpful. I’m thorough but I’m also too eager to learn AS to spend time learning JS, however beneficial in the long run.
I already like the writing style and organization of the book. It seems redundant in the best way, meaning you introduce a subject with a general explanation and the promise that you will return to it in depth in future chapters. I learn best with repetition and I suspect many others do as well.
Thanks
S
Rich and Zevan,
Thank you for writing this book! I’m going to attend Colin Moocks AS3 tour training, and was looking for a way to be well prepared. I’d bought Colin Moocks book and I can see how this book in the future would became as valuable to me as my Javascript The definitive guide. But for now, it’s was a bit overwhelming to me, especially since I’m not an expert Flash user. So I picked up your book and and it picked up my spirit! I do a chapter a day and it’s going very well, I definitely be well prepared for the training day.
By the way: like Vlado, I’d love a book about Flash remoting, especially if it’s written in understandable language like this book. You struck the right tone too: I’m not a dummy, but not a genius either so I don’t want to be spoken to as if I am either one! Thanks again.
Thanks very much for the book. I got it after reading Lee Brimelow’s recommendation and I’ve not been disappointed.
Thanks guys!
Your book is wonderful! All I can say is…
WOW and then WOW again backwards!
This is what I’ve been looking for. I’m new to flash (I’m 4 weeks into my flash education) I’ve been just learning via video training from lynda.com and learnflash.com as well as several other web resources… but up until this point no books…
Until to day!
Well now I’m off to poke around your site a bit and see what I can discover.
Thanks again mates,
Jay
@Steven, @Marion, @IsmetM, @Jay
(All these comment references make me hear The Night Before Christmas: “Now, Dasher! now, Dancer! now, Prancer and Vixen!” Heh.)
Welcome, all. We really appreciate the words of encouragement and we hope you get a lot from the book and this companion site.
Hey Guys,
I am enjoying the book so far and am about to begin the exercises with the downloads. I have never been a programmer, so I am hoping you know of a basic glossary that can define and explain the origin of programming nomenclature (arguments, etc.) in very simple terms. I must say that I have been able to follow the book so far anyway. Thanks.
-Tom
The best book I’ve seen on ActionScript 3.0, (and I’ve seen a lot), well written and in a way that someone with a design background (like myself) is likely to find easier to understand…
Cheers - Dom
Group IT Director
MediTech Media Ltd
London
i am enjoying book so for. this book helps exiting people.
Yes,
I’ve read quite a few Action Script books, including Colin Moock’s and also the documentation of Flash CS3 itself and this is perhaps the best. It explains concepts in an easy to understand way and gives new insights. e.g. I’d never before seen a sprite described as a movie clip without a timeline, yet the description helps understanding enormously.Again, I’ve never really seen the void data type adequately explained anywhere else - it tends to be assumed you will know it.
This book is the book I’ve been looking for. It’s the only one I’ve come across which actually makes the learning process enjoyable and understandable at the same time.
Best Flashbook I have seen around …
thanx for that Folks
cheers
Mark
Thanks for writing such an easy and enjoyable book to read. You have demystify a lot about AS and make it easy to follow through. I have just bought the book to learn about AS. I like the hands-on exercises which helps me a lot to understand what i read.
I will be back to continue my quizzes exercise and see what is going on here.
Kiitos!(Finnish: Thanks)
Alfa
Guys,
Thank you for the Errata regarding Chapter 4 P69. I think it would be helpful to also mention that this code does required two objects to exist in the Library: Btn and NavBarBack.
Thanks for a good book. Nice progression and good examples.
Doug Edwards
Orange County California
“Learning ActionScript 3.0″ get my vote too!
There are plenty of newcomers praising this book, but I just wanted to say that I have been programming for a long time - even considering myself reasonably well-versed in ActionScript 2. But I could tell there was enough changed in ActionScript 3 that I was going to have to do a lot of reading, and didn’t want to do it all on the computer, so I bought this book (despite the title - luckily, nobody saw me purchase it
The verdict: I’m very glad I did. I guess from an ActionScript 3 perspective I was a beginner, and this book was a great way for me to get my feet wet.
I WON’T say that I am a big fan of ActionScript 3 however. I dislike a lot of the changes they have made and are making, but who am I to say? At least now I can keep up with the changes they are making.
Personally, I found even the ActionScript 3 section of the help system that comes with Flash to be cryptic and hard to understand until you have a basic understanding of the new model - like you can get from this book!
So, thanks Rich and Zevan.
One of the most books on my best books shelf speaks so clearly out to me, thank you for writing it and to flashcoders for the bridge. I want AS3 all the way as a beginner. Is Flex really necessary for a small time guy?
Thanks for all the thoughts, everyone. We really appreciate it.
@George, the ’small-time guy’ qualifier may not be the right decision making factor. Flex is better than Flash for some things and vice versa. in general (flame wars are not useful to anyone), Flex is targeted to developers working on applications (including feature-rich web sites), while Flash is more often (see how careful I’m being?) used for animation, games, designs, experiments, etc. Flex has a framework that uses a tag-based language (MXML) and elaborate components to accomplish a lot in the areas of UI, data binding, charting, etc.
The AS3 you learn will be applicable in both cases. Try learning one until you’re comfortable, and then take a look at what Flex offers. If you think you’ll be doing a lot of app work, download a trial and see if you like it.
Hello
I have been working in Flash for years, and I know what people mean about the Help section for AS3 being “cryptic.” If you’re not thinking in an OOP hierarchical framework, you are Toast!
Enjoying your book a lot, but like every good - or maybe just ‘old’ programmer - I am lazy and came here to download the examples for the scripted video.
I’m a Distance Ed director and I also thought - upon encountering the description of this website in the book - that it might be a good example for a one of the developmental workshops for the faculty at our institution. We shall see. I hope so.
In the meanwhile, I am enjoying the book a lot. I like that it is not obscure. Again, good programmers are lazy . . . too much code is best for the new Pizza Hut deliver option.
Best,
Mia Kalish
hi rich
i’ve seen your tutorial called “flasch cs3 essential training” by lynda and it really was good ,
but i was surprised because you didn’t proceed the series with the title “beyond the basics”
i’m also watching the “beyond the basics” title but i don’t think it will be as efficient as the one you made
regards.
@most hacker: Thanks. I finished “Beyond the Basics” but, unfortunately, Lynda.com decided to go another way and there wasn’t anything I could do. I’m glad you liked the Essential Training title, and I hope you enjoy the book.
Just started learning actionscript 3. Ihope i can learn easily with is book. i’m on chapter 5 and getting kinda lost but then things start to make since. i wish there was an online credited class to take some where.
Hi Rich, Zevan and all of you
i really do not know what to say
this book is The One
very simple to follow, easy to understand
is there a next step so there is part 2 from this boook for the next level, i hope so
i am really waiting the TRAINING SECTION.
regards.
One more thing
Stephen menstioned 2 books, is it good for designer like me who want to move to programing languages, these books:
1)repositories of introductory programming tutorials
2)computer science best practices
i tried to search but i could not find it in google or amazon
any help to find them or relivant books
Thanks
looking forward for more information about this. thanks for sharing. Eugene
I just wanted to say thanks for a fantastic book - I’m only on Chapter 3, but I’m already really taken aback by how good it is! It’s very rare that I find a technical book I can sit and read and really pay attention to, but the style this is written in really keeps my attention and makes sense. It seems to be exactly what I was looking for as a newcomer to Flash programming, the on-line tutorials I’ve found just never seem to be quite at the right level, or have the right amount of detail.
Right, I’m off to go download the accompanying source code to start on my first exercise!
Just purchase the book and never has source code but now know can get here ,thank, it great book for beginner like me
I just wanted to say thanks for a fantastic book
Hi Rich. The book continues to be a hit with my group. Some of our graphic artists who want to get into Flash have been reading it. They also watched your Linda Flash CS3 videos, great training material. I was wondering if you could recommend a good JavaScript book for me. I’m a decent AS3 OOP developer, but I’m a little embarrassed that I don’t know much about JavaScript. Reviews on Amazon for books are all over the place. Some books seem to be written with traditional C programmers in mind. I’m not sure if that’s the same perspective as Flash developer. Thanks in advance.
Belated thanks to @Jo, @dev, and @Iemaza!
@Alex, we’re glad you like LAS3 and appreciate your kind words.
As for JavaScript books, I tend to recommend a range of titles, based on skill set and experience level. For beginners, I usually recommend the Peachpit Visual QuickStart series. For intermediate to advanced users, lately I’ve been recommending Dennis Crockford’s JavaScript: The Good Parts (O’Reilly), and John Resig’s Pro JavaScript Techniques (Apress). (Resig wrote JQuery.)
All three recommendations (with AJAX thrown in to the QuickStart selection) can be had here. You should also check out the great video lectures from Crockford and Resig, as well as other goodies, from Yahoo’s YUI Theater. They’re a must.
I like your book, especially as it makes AS3 fairly easy to understand for both non-native english speakers and for non-programmers. To be honestly, I didn’t read any review on your book before I bought it, I bought it by the brand :D.
I just found this site surfing google. I love it. Looking forward to learn more about ActionScript. THANK YOU!
Just recieved your book by mail yesterday. Learning Actionscript 3.0 - is a well written book and easy to understand. Thanks for making this book
Thanks to @Geobart, @Ophir, and @Brian!
Hello Rich,
I’m a new student to AS and needed a good book to supplement the course at Lynda.com. This is a great book! Thanks. No really… I’ve recommended it to two people already.
Last quarter, I had to drop out of school but I continue my studies just as if I were in class. The only element that would truly round-out this education would be chapter-based mini projects; perhaps as part of an overall project. This would help to place an expectation on the topic take-away and reinforce the teachings. Do you think this type of project-based supplement could be added to the site?
Newbie hoping to see the potentials of Flash/Actionscript…
I’m wading in here and interested in Flash. You’ve published some code on “Planetary Orbits” on another web-site.
Might there be some place where we could see this code in action?
@Test, you can see the code in action in the accompanying source files. They can be found at the bottom of the article. They are in AS2 (the article was written in 2005) and, while I may update it to AS3, it won’t be for a while. Planetary Orbits.
I’ve never seen such a great document for learning fundamentals of a language and their immediate application as your book!
Definitely the touchstone that then can lead to AS3 Cookbook, Moock etc.
A truly thrilling work, thank you.
Don
@Don, thanks so much!
@Arlene, there are several chapter-specific sample projects but there are currently no plans to create an ongoing project. I find that to be less successful when teaching an intro to a language because too much focus must be dedicated to supporting infrastructure that does not apply to the chapter at hand.
Every learner, instructor, and author has their own opinion about this topic, and it is sometimes applied on a case-by-case basis. For example, my sister book, Learning Flash CS4 Professional (O’Reilly) does take this approach. However, a cumulative project was too unwieldy when teaching AS3 from scratch.
HELP!!!
PLEASE:)
Hello,
I need help with some actionscript!;)
my slideshow is almost workin but i am getting an error message saying:
1084: Syntax error: expecting rightparen before SimpleButton.
Here is what my code looks like:
stop(); //next button SimpleButton.addEventListener(next_btn.onPress=function(){ if(studio_art1._currentframe==studio_art1._totalframes){ studio_art1.gotoAndStop(1) }else{ studio_art1.nextFrame() } } //last button SimpleButton.addEventListener(back_btn.onPress=function(){ if(studio_art1._currentframe==1){ studio_art1.gotoAndStop(studio_art1._totalframes) }else{ studio_art1.prevFrame() } }@matty, there are several issues with your code.
The first thing is that you’re mixing AS2 and AS3 syntax. _currentframe = currentFrame and _totalframes = totalFrames. There is also no onPress event handler in AS3. You’re mixing AS2 event handlers with AS3 event listeners.
In the AS3 syntax, you’re attaching a listener to the SimpleButton class, instead of an instance of that class.
Finally, this is sometimes a matter of taste, but, considering the issues, I would recommend staying away from anonymous functions when you migrate from AS2 to AS3/learn AS3.
I just wanted to say “thank you” to the authors for putting a site online that accompanies the book! Wow! Especially one that is as easy to use and to correspond on. Thank you! I’ve been learning “C” and “Obj C” and I won’t mention which books I bought for those subjects, but they sites are so primitive and hard to navigate - and one of the books is a new release. Thank you guys!
I take it the user form isn’t going to happen? Great book! (I’m a quarter of the way through).
1151: A conflict exists with definition _label in namespace internal.
i need help please
@ismael, your post does not give me enough information to help you. There is nothing in this welcome post that has to do with _label. I will try to make a guess.
The error means that “_label” is used somewhere else. There are two common ways this can happen. The first is when you reuse the same variable, such as this:
for (var i:int = 0; i < 3; i ) { trace("hello"); } for (var i:int = 0; i < 3; i ) { trace("goodbye"); }The same variable, i, is defined twice. If you remove the declaration from the second use, it will not cause a problem:
for (var i:int = 0; i < 3; i ) { trace("hello"); } for (i = 0; i < 3; i ) { trace("goodbye"); }The second reason is that an instance is declared both on stage and in your code. This occurs when you apply an instance name in the Properties panel and also declare a variable to refer to that object. To avoid this, you can either do one or the other (but not both), or uncheck “Automatically Declare Stage Instances” in the file’s Publish settings (File > Publish Settings > Flash > Script (ActionScript 3) > Settings).
@Justin, thanks very much! @Austin, we tried the forum but it was being abused and neither Zevan nor I have enough time to moderate it as much as is required. It’s the same old cliché about a few bad apples. There are many forums out there, such as Kirupa.com, ActionScript.org, and others, as well as mailing lists such as FlashTiger (a Yahoo Group). I hope you have some luck at one of these locations.
Hey Rich, great book! I’m just wondering… is there a forum where topics in your book are discussed?
@Graham, I’m afraid not. We started one, but it was overrun with spam and we didn’t have the moderating labor required to make it successful, so we had to abandon it.
Hello,
I have just started your book, and I’m truly a novice. Please bear with me if my questions are a bit obtuse…
I’m in chapter 2, reading through the various conditionals, loops, etc. Am I supposed to be able to test these examples out on my own computer? I did the document class example in chapter 1, but I haven’t been able to figure out how to make anything happen with the examples in chapter 2– or even if I’m supposed to try them out. In other words, after I copy the actionscript, what steps do I need to do to get to an output panel?
Thanks!
@David, First, LAS3 assumes at least a rudimentary knowledge of Flash, so you may have trouble without some Flash background. (I’m assuming this, based on your comment, so forgive me if I’m wrong.) You may want to check out my companion book, Learning Flash CS4 Professional for information about Flash.
Second, which code entries you choose to test yourself is, of course, up to you. I would recommend typing everything in yourself to better learn it. However, most of the code in the book can also be found in the downloadable example files for each chapter. Several small passages of code in the book are just explanatory (such as demonstrating syntax) but nearly all large passages can be executed.
To see a trace appear in the Output panel, you just “test” or publish your movie. The native Flash file is a .fla file. However, the runtime version, or .swf file, must be compiled. You can test your movie using Control > Test Movie –or Ctrl-Enter (Win), or Cmd-Return (Mac). That will show the SWF within Flash. At runtime, the AS executes and the trace will appear.
Note, if you publish your movie and view it in a browser, you will not see traces without other fairly significant edits to your system (like a browser plugin, and a system config file, etc.).
Hi, this is my day 2 with your book and I find it very useful. Thank you for the great book. I’m a total beginner with Action Script and programing in general and I’m also new to Flash. So far I managed to follow everything but at the moment I’m unexpectedly stuck at something that really makes me feel very dumb asking for help about it. I’m at the Inherited Attributes introduction trying to follow these instructions:
“To simplify things, the x and y properties are typically listed as inherited
properties, as is true in the Flash help system. To view inherited properties,
for example, in the Flash help system, just click the Show Inherited Public
Properties link found immediately under the Public Properties header.”
I spent almost an hour trying to find where is this without any success. I’m using Flash CS4 Professional. I first tried from the main menu, Help > Flash Help but didn’t find anything even remotely similar to a link “Show Inherited Public Properties”. I made a search for “Inherited Public Properties” and “inherited properties”, even searched for the term “Flash help system” but the results were not helpful. I also tried looking hard at the Actions window for some code help system but at no avail.
I feel real uneasy to bother you with such request but will appreciate greatly if you give me additional details.
Thank you.
@Ross, ask away!
Unfortunately, Adobe introduced radical changes to the Help system that most users dislike, including making it much more difficult to get to the ActionScript Language Reference materials, and adding a Google-like onslaught of community returns for every search.
One way to get to the AS3 Language Reference from within Flash is to highlight the ActionScript you want information about before consulting the Flash Help menu item in the Help menu. Here’s a clean walkthrough to demonstrate:
That process (higlighting the AS you’re curious about first) should go right to the AS3 Language Reference. Some AS is common to multiple classes (such as the x property) so you may not always get exactly what you want, but you can search within the Lang Ref at that point. In this case, highlighting MovieClip should get you to the MovieClip class and you’ll be able to scroll down to see the Properties and Hide/Show Public Properties to see what I meant in the text.
One note about your learning process. You might think about other venues for questions, too, instead of this blog when appropriate. Being new to Flash, you may have many questions, and they may not always be appropriate for a blog. That is, you may have questions about Flash (as opposed to AS) or may get a wider/faster response if you join a mailing list (like the Yahoo Group, Flash Tiger) or forum (like Kirupa.com).
This is still a good place to ask about the book specifically, or about AS3 in general. Another resource for Flash interface questions is my companion book, Learning Flash CS4, also published by O’Reilly.
Good luck!
Thanks Rich, great advice and tips.
on Windows Vista I managed to access the relevant Language Reference by right clicking on the highlighted code and choosing Help.
Thanks again.
Hi,
may I suggest this website as a resource? http://tutorials.as3.ca I agree it needs a redesign, but the content is golden! It is a collection of the best actionscript tutorials to be found on the net, organized by subject and difficulty level. So far i have 70, but I keep adding about 10 a week.
Thank you
Martin
Hi,
I have used your book to help me in building a new and improved website which I plan to launch soon.
I am currently having a problem that I hope someone can help me with.
I have a flash player component which I am using to load different animations into. Twelve in all.
I have a main menu and a “back to menu button” which also stops the flvPlayer. This works perfectly.
However, in addition, I would like stop the flvPlayer from the home button, which sends the user to the main page and is outside of the players timeline.
Using the book as a reference, it seemed I could use and addListener(Event.EXIT_FRAME, stopPlaying);
but that just stops anything from playing.
Any suggestions would be great.
I got it to work by placing this into the code -import fl.video.FLVPlayback;
I wrote a stop action from the main time-line. I’m not sure if it is the most elegant solution bit it works.
I could not have figured this out two months ago but thanks to your book and all of the resources you have provided on this site I am slowly seeing how everything goes together in AS 3.0
Cheers
Thanks for the great book.
I bought yesterday and I am very happy.
Thank you very much!
Wow! Thought I was losing the plot but now it’s all coming together in Chapter 6. Good book - thanks!
Finished reading your book, just thought I would stop by to tell you how much I enjoyed it. This book is indispensable to those learning actionscript 3.0 even if it is your first programming language. Thanks!
@john, @Paulo, @NA, @Mike: Thanks for the words of encouragement!