Babysteps in learning Flash
December 7th, 2006 . by polyGeekLearning Actionscript is like putting together a puzzle, as are many things. You start with the obvious stuff first - the edges.
So you have a few basics down and then you need to do a project that requires you to use code that you’re unfamiliar with. So you learn just enough to get the job done. It may not be organized code and it may make a seasoned developer cry if they see it but it works - that’s what matters, right? This is like finding a few pieces of a puzzle that fit together but you don’t know where they belong in the overall picture.
So you keep adding on these little groups and sometimes you discover that they fit with a part that you know well. Like fitting a group of assembled pieces to the edge of the puzzle. More and more the picture is coming together.
Of course, those little groups of understanding fade away if you don’t use them often enough.
The real problem with learning Actionscript is that you can’t really see the big picture until you know it pretty well. When you’re starting out you might read about objects, arrays, whatever and you don’t know if that’s a huge part of the puzzle or if it’s a little part of the puzzle that’s easy to understand.
There is also room for confusion between what is Actionscript and what is really the Flash Players DOM (Document Object Model). You see, there really isn’t all that much to Actionscript. You have your variable types, if/then, for/loops, a few other odds-and-ends and your done. Maybe a few chapters of a book at best.
The Flash DOM on the other hand is huge and growing with every new release. The DOM includes things like, ._alpha, ._x, ._y, getNextHighestDepth(), XMLSocket(), the list goes on-and-on.
So Actionscript is what the language can do, like loop through an array, and the DOM is what the Player can do, like change the _alpha of a MovieClip.
My suggestion is to concentrate on understanding Actionscript first and then filling in the blanks of the Flash Player DOM as you go.
With that said here’s a general list of the things you need to learn and understand in what order.
- Creating variables : There aren’t that many variable types in AS. Initially you should feel comfortable with Number, String, and maybe Boolean.
- Functions and scope : First get used to creating and using functions. As soon as you feel good about creating functions you should learn how to pass parameters - variables - to a function and then later how to return a value from a function.
- Arrays : Learn them. Love them.
- Conditionals : Lets go loop-de-loop
- for loops : for-loops go hand-in-hand with arrays. You’ll see.
- if-then : if this then do that. The cornerstone to any language.
- if-then/else : just to cover all your bases.
- if-then/else if : the other condition
- switch/do-while/while/ : you won’t use these all that much but when you need them they really come in handy.
- Tertiary “?” operator : you could go your whole life without ever using this thing but when you learn it you’ll love it. Essentially it’s a very concise version of an if-then/else conditional.
- Objects : Once you have everything in Actionscript nailed down solid you’ll still be learning all the in-and-outs of objects. And don’t confuse objects with Object Oriented Programming. First you learn how to manipulate existing objects. Later, you’ll create your own - that’s the OPP part.
- Types : A String is not the same type as a Number, duhhh.
- For-in loops : Previously you learned how to loop through a sequence of numbers, like count from 1-to-10. For-in loops run through an Objects properties. Very handy and very powerful.
- Listeners and events : “Listen . . . do you smell something?” :-) Events are happening all the time. You just need to listen to them and do something about it.
- Object Oriented Programming : You know about using objects now get ready to create them.
- Design Patterns : An extension of OOP. If you get this far you are now an Actionscript guru.












Fabulous article as always. Thats how I learnt actionscript - well i say learnt, but to be honest i just hack things together still :-)
Hacking is how things get done. We would all love for our code to be worthy of framing but at the end of the day it doesn’t matter, so long as it works.
Still there is something to be said for elegant code. Just as art, ya know? A perfect ideal to hold up and aspire to?
Reading your post, my route to ActionScript training has been different. There are some aspects that I understand better than others.
For example, variables. I’ve used them… and I know the definition by heart, but I can’t seem understand them. I can’t determine when I need them. The same with arrays.
I’m not a programmer, so this stuff just doesn’t come to me naturally. Is there a tutorial or book that explains these things in good, understandable detail? I’ve tried MANY books and websites already, and giving up isn’t an option.
Anyway, great blog. I’m now a subscriber. I’ll be honest… the word ‘geek’ caught my attention. Serenity would’ve been higher on my to 10 list.
@Vazquez, I’m glad you’ve found my blog useful and thank you for the kind words.
I understand the situation you’re in and you’re not alone. I’ll try to think of some good articles to write that might help you and others who are in the same boat. Now that you’re subscribed you’ll see when they get posted.
I have a lot to do this month before the MAX conference so I may not get to it until October.
Leave a Reply