ActionScript 3.0 is the internal programming language for Flash, Flex, and AIR (the Adobe Integrated Runtime application).
With AS3 (ActionScript 3.0) you can write instructions to control the elements in a Flash presentation. For example, you can add instructions for buttons to play and stop an animation, or to change the color and size of an object. Also, ActionScript can be used to add objects (shapes, lines, text) in a Flash presentation without creating them on the Stage.
ActionScript is the programming language used to create Flash games which can be included in Web pages.
ActionScript 3.0 was introduced by Adobe in 2006 with "Adobe Flex 2.0".
It is a scripting language similar to JavaScript, for example, both languages uses the keyword "var" to declare the variables, the strings are joined with the "+" character. If you know JvaScript, you'll understand and learn faster AS3.
ActionScript 3.0 requires an object-oriented approach, includes some of the new concepts of object-oriented programming (OOP): classes, objects, methods, and events.

To create a Flash presentation which uses ActionScript 3, open a new document choosing "ActionScript 3.0" from the "Create New" column in the Flash start window (or from File -> New).
You can place the ActionScript code in frames in the Flash Timeline, or you can place your code in a completely separate ActionScript (.as) file.

For a start it will be shown how to add the code directly into the document, in Frames in the Timeline.
After you have opened a new document, create a new Layer in the Timeline (from Insert -> Timeline -> Layer) and call it actions or scripts (you can change the name of the Layer by double-clicking on its name).

It's better to keep your ActionScript code in a single layer at the top of the timeline that holds only AS3 code. Also, you can use any name for this layer, but it's better to have a suggestive name.

The ActionScript code will be write in a special panel (an Actions panel, shown in the picture below).
To open the Actions panel, cick a keyframe where you want to add your code, then click Window -> Acions (or press F9).

Actions panel

Actions panel
- The Actions pannel is used to add code and AS3 instructions in the Flash document.
- At the bottom of the picture is the Timeline panel, with the layer "Actions" created for adding ActionScript codes to its Frames. The code here is added in the first keyframe.
AS3 is case-sensitive, so: "you", "You" and "YOU" are three different things.

Daily Test with Code Example

Which tag renders as emphasized text, displaying the text oblique?
<strong> <pre> <em>
<p>Web development courses: <em></em></p>
Which CSS property defines the space between the element border and its content?
margin padding position
h3 {
  padding: 2px 0.2em;
Click on the method which returns the first element that matches a specified group of selectors.
getElementsByName() querySelector() querySelectorAll()
// gets first Div with class="cls", and shows its content
var elm = document.querySelector("div.cls");
Indicate the PHP variable that contains data from a form sent with method="post".
if(isset($_POST["field"])) {
  echo $_POST["field"];
Introduction to ActionScript 3

Last accessed pages

  1. JavaScript Course - Free lessons (12616)
  2. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (54303)
  3. Drag Racer V3 (4625)
  4. Particles (391)
  5. Bubbles3 (34586)

Popular pages this month

  1. Bubbles3 (2864)
  2. Butterfly Kyodai (2473)
  3. Zuma Deluxe (1769)
  4. Qwop (1183)
  5. Backgammon (1081)