Chapter 3. Working with ActionScript
This chapter covers
- Comments
- Variable types
- Operators
- Loops
- Conditions
- Arrays
- Functions
In chapter 2 we introduced ActionScript. But what exactly can you do with it? As you’ll soon see, quite a bit.
ActionScript is an extremely powerful object-oriented language about which you can dedicate entire books. In this chapter we’ll focus on ActionScript’s core concepts; obviously you’ll need to be familiar with them before we get to the more powerful aspects of Flex itself. Speaking of which, you’re probably anxious to get back into Flex, but tackling some ActionScript fundamentals will allow you to pick up the pace and move forward more quickly.
A fundamental concept in any programming language is that of comments, so we’ll begin our discussion with how Flex supports documenting your code.
A basic construct of any programming language is the ability to document the mechanics of an application from within the code itself. You’ll learn to do this through the use of comments.
From the perspective of implementation, a comment is a sequence of delimited text that’s ignored by the Flex compiler. Flex’s ActionScript language supports two popular formats: inline comments with regular code and block style with multiline comments.
The first comment type is the inline style, which you invoke using double forward slashes: