ActionScript Fundamentals

ActionScript, as mentioned throughout this chapter, is the programming language of Flash, but do not let that intimidate you. Unlike many other languages, ActionScript allows its programmers to write minimal amounts of code and still see results.

You can type in this simple line of code, test the movie, and something will happen:

 trace("something happened"); 

Now granted, it is not doing muchjust simply sending a message to the Output panel, but it is still doing something. You can see the results of your hard work in writing that line instantly, and that's what ActionScript is about. Of course, the more ActionScript you put in, the more results you will get out of it. And that is what this section is for.

In this section, we will briefly go over many pieces of ActionScript that are covered in more detail as you continue through this book. But this section will show the simple uses of these pieces to get simple results.

Looking back at that one line of code we just used, if I hadn't mentioned what it was going to do, the only way you might have known is by testing the movie. When you see the results, you know what the trace function does; it sends messages to the Output panel. Of course, there was only one line of code, so it was easy to see which line sent the message, but what if you had 500 lines of code instead? It would be that much more difficult to figure out which line of code sent the message to the Output panel. This is why developers use comments.

Macromedia Flash Professional 8 Unleashed
Macromedia Flash Professional 8 Unleashed
ISBN: 0672327619
EAN: 2147483647
Year: 2005
Pages: 319 © 2008-2017.
If you may any questions please contact us: