So you are new to ActionScript?

Many users new to ActionScript have often asked me, “How do you learn to code?� They sulk when I tell them that I have a background in programming and have actually written programs in several languages.

They proceed to convince me that they have done their homework and tired to read the documentation but can rarely figure out how to do the things they need to. They have spent hard earned money on two or three programming books that take them a day or two to find the time to read and when they crack open the cover they quickly discover such material works really well as a sleeping pill. The same can be said for instructor lead classes and even some of the online tutorials.

Feed up with painstakingly searching the internet for canned solutions, and even expensive 3 rd party software they begrudgingly use on their projects with most results leading to the usual frustration of getting things to “almost work� they long for the day when the secrets of coding would be revealed to them.

If this sounds like you at all then don’t loose heart. I have a little practical advice.

There is no magic, and normally no secrets all the programmers are hiding from you. You don’t have to be some super geek or intellectual genius to learn to code. Also, programming is not just something “someâ€? people can do and some people can’t, anyone can learn to write code especially ActionScript.

That is not to say that there aren’t some people that would seem are born to code, scary smart people exist in about every profession, but most of us were where you are now at some point before, even if we tend to forget what it was like. What you need to get you on the right track is first, a change in your perspective.

I have made few simple rules/recommendations that may help you along your way:

First fundamental rule; programming languages, especially ActionScript, are designed for YOU to use. They are not just for the scary smart folks, and you don’t need a degree in computer science to become a good programmer. This seems a simple concept but I assure you that the assumption that you can never learn something or that it is not designed for “people like youâ€? can be more of a barrier to your success then anything else.

Second rule; most programming books are thick and not really designed for you to read them cover to cover. Think of them is instructions broken up in to sections. Like the manual you get for a new car. The car is designed for you to drive it. You only need the manual to learn about a particular feature or maintenance. You will use the book as a reference and jump around from section to section to learn about when you need as you need it. Taking a similar approach to your programming books can make them far less intimidating.

Third rule; start small. Give yourself the chance to learn to walk before you run! I can’t count the number of times a brand new Flash user boldly enters the user forum with a URL to a professional website built by a team of 5-12 experts and asks “can someone tell me how they built that site. That is exactly what I want to do!â€? Sorry, but few things in life work that way. There is a reason most coding platforms and language manuals start with the “Hello Worldâ€? program and it is not because programmers find it amusing.

Start with the basics, one line of code that does just one simple thing. Work you way up to several lines of code that perform a sequence of small tasks that lead to a single result. Then learn about loops, and conditionals. Finally learn about functions. These things are the basics of procedural programming. Procedures are a logical list of steps that accomplish one thing at a time resulting in the completion of a larger task. It is like giving the computer a cooking recipe only instead of cookies you get functionality when out of the oven, or in this case, the compiler.

Rule four; now this is the hard part. Most of us don’t have the luxury of writing dozens of little programs to teach ourselves one concept at a time. We have jobs to do and weekends to enjoy and unless you are sitting in a programming class, there is little that is going to encourage you along your journey of discovery. So don’t make it hard on yourself. Do as small project they way know how. Build your motion tweens on the timeline. Use what every tips and tricks work for you. Get the project finished and take the pressure off. But afterwards open up your project so you have a goal to aim for. Then create a new Flash document and do everything you can to build exactly the same thing, entirely in ActionScript.

Yes, it is has hard as it sounds, but since you know what the final outcome should be, and you don’t have to race for a deadline you can work on it just a little bit every day. Break down your final goal into the simplest of tasks that you can do in ActionScript one line at a time if necessary. Search through the documentation that lets you draw or attach your symbols on the stage and look for classes, loops, and events that can help you perform any animation. At some point you will finish recreating the project and you will have learned how to read the documentation and APIs. You will remember the basics of syntax, and most important you will have learned how to break down your final goal into a sequence of small tasks in your code.

Now this could take a while so again let me stress that you should start small. Try something like the animation of a bouncing ball or the creation of a web form. Choose something that has visual features that you can easily relate to what is going on in your scripts. For example the bouncing ball is a symbol wrapped in a movie clip that changes position over an interval of time. It is not hard to see that you have to draw the symbol in a movie clip and change the x and y value of the movie clip over time to end up with the same result as your motion tween of the bouncing ball. Knowing what you need to do and in what sequence is more then half of the challenge of coding. They rest comes down practice and experience which shows you how to do it in the most efficient ways.

Believe it or not, you do this a few times and suddenly the documentation will make a little more sense. Those big programming books will become a little easier to read, and soon you will be back engineering those tutorials and third party tools in order to make them work better for you!

15 Responses to So you are new to ActionScript?

  1. Tim Wilson says:

    Good Advice, I learnt actionscript that way. I started with a simple if/else statement and now I have developed several RIAs.

  2. Thanks for your words of encouragement. I’m in the process of starting my own web development business and although this entry doesn’t apply to what I am doing, the concept is still the same.

  3. Ken says:

    I am glad you liked the entry. Feel free to add any tips for new user’s or post suggestions for new topics.Thank you!-Ken

  4. stacey says:

    – rip apart code. You might not understand it at first, but find something you are motivated to know about ( how to do an effect…etc).- learn to use the help files. They contain a whack of great code snippets- give yourself a project and do it. Put things in practice.

  5. Mani says:

    I learned the hard way that grabbing EAS2 and trying to plow through it won’t magically teach me the years of ActionScript that the people who should be reading the book have already accumulated. Many books read way-way-way differently now that I have not just seen the prerequisite info but absorbed the meaning.

  6. hal2k says:

    thank you so much

  7. Ted Patrick says:

    Ken,You really could be the IFBIN spokesperson with a post like this. Most of your core points are IFBIN design goals. The key is that developers explore working software vs trying to build from scratch. Check out Flash By Example and Flex by Example when you get a chance.http://www.ifbin.comKen, drop me an email when you get a chance.Regards,Ted Patrick

  8. dickbob says:

    Hi,Can you help with Flash Remoting issues?The end objecttive is to click a button in Flash, a ColdFusion .cfm window opens with no URL name/value pairs but a record id is passed through for the CF page to get the db record, process and display.My prob is getting the data passed out to CF.I can pass the data out to a CFC, no prob but the data inside the CFC component doesn’t persist and so my .cfm page can get the data out of the object.Thought?

  9. Ken says:

    Hi dickbob,Sorry but my expertise is in Flash specifically. You would get better help if you open a support incident because you would get one or more engineers that could help you with the Cold Fusion side of your application. Now if you have everything working but your Flash UI then I could probably be able to help you in a more timely fashion. hope that helps,-Ken

  10. dickbob says:

    Okay Ken, thanks anyway 🙂

  11. simon says:

    Thanks for the kind advice, any advice on how to start converting existing code into classes. Searched for a simplistic way to achieve this but to no avail.Ta Simon

  12. Summer says:

    hey..i’am taking a course right now..ive been 2 weeks into it and have been having a hard time understanding it..i have a do a project making a presentation useing movieclips as buttons.The “macromedia tut.” crap dosent do there a site i could go to?

  13. Ashish Rai says:

    hi, thanks for the motivation..I started loosing interest but after ur comment i will restart fresh..Please tell me something about Flash Stick Fight, or character..

  14. Ken says:

    There are lots of resources on Adobe DevNet. Even if you don’t understand everything you should try a few toturals tht are inline with your interests.That can really help when you are starting with Flash and ActionScript for the first time.

  15. Alia Curtis says:

    Sound advice and great motivation to someone who has little tech knowledge, but wants to jump in and change careers. Things can be intimidating and it is good to be reminded that one has to start small, be patient and take things step by step.I’ll remember that as a “chill-out” factor when I’m tearing my hair out :)Thanks much