2008/10/30

About Behaviors

Behaviors are predefined ActionScript functions that you can attach to objects in your Flash
document without having to create the ActionScript code yourself. Behaviors provide you
with prewritten ActionScript functionality, such as frame navigation, loading of external SWF
files and JPEGs, controlling the stacking order of movie clips, and movie clip dragging.
You can use behaviors as a convenience when building your Flash application—as a way to
avoid having to write ActionScript, or conversely as a way to learn how ActionScript works in
certain situations.

Behaviors are available to you only when you are working in a Flash document, not in an
external script file. Typically, you select a triggering object in your document, a movie clip or a
button, select Add on the Behaviors panel to display the available behaviors, and then select
the behavior you want, as shown in the following example:

About the Actions Panel

You use the Actions panel to create ActionScript in a Flash document (a FLA file). The
Actions panel consists of three panes, each of which supports you in creating and managing scripts.

Actions toolbox Use the Actions toolbox to browse a categorical list of ActionScript language elements (functions, classes, types, and so on) and then insert them into the Script pane. You can insert a script element into the Script pane either by double-clicking or dragging it directly into the Script pane. You can also add language elements to your scripts by using the Add (+) button on the Actions panel toolbar Script navigator The Script navigator displays a hierarchical list of Flash elements (movie clips, frames, and buttons) that contain scripts. Use the Script navigator to move quickly between all the scripts in your Flash document. If you click an item in the Script navigator, the script associated with that item appears in the Script pane and the playhead moves to that position on the timeline. If you doubleclick an item in the Script navigator, the script gets pinned (locked in place).

2008/10/26

ActionScript 3.0 And New virtual machine

ActionScript 3.0
ActionScript is the powerful object-oriented programming language of the Adobe Flash Player runtime environment. Based on ECMAScript, the international standardized programming language for scripting, ActionScript 3.0 further advances the language to offer developers a robust programming model for rich Internet applications (RIAs). Developers can achieve superb performance and ease of development to facilitate highly complex applications, large datasets, and object-oriented, reusable code bases. Executed within the new ActionScript Virtual Machine (AVM2) in Flash Player 9, ActionScript 3.0 delivers breakthrough performance for the next generation of RIAs.

New virtual machine
Flash Player 9 includes a new, highly optimized ActionScript Virtual Machine (AVM) known as AVM2. Built from the ground up to work with the next generation of ActionScript, the new virtual machine is designed to deliver the performance and features to support the needs of rich Internet application developers. AVM2 supports full runtime error reporting, built-in debugging, and binary socket support so developers can extend the player to work with any binary protocol. Flash Player 9 also contains AVM1, which executes legacy ActionScript for maintaining backward compatibility with existing content.

2008/10/25

What is ActionScript

The main features of ActionScript 2.0 include the following:
Familiar object-oriented programming (OOP) model The primary feature of
ActionScript 2.0 is a familiar model for creating object-oriented programs. ActionScript 2.0 implements several object-oriented concepts and keywords such as class, interface, and packages that will be familiar to you if you’ve programmed with Java. The OOP model provided by ActionScript 2.0 is a “syntactic formalization” of the prototype chaining method used in previous versions of Macromedia Flash to create objects and establish inheritance.
With ActionScript 2.0, you can create custom classes and extend Flash’s built-in classes. Strict data typing ActionScript 2.0 also lets you explicitly specify data types for variables, function parameters, and function return types. For example, the following code declares a variable named userName of type String (a built-in ActionScript data type, or class).
var userName:String = "";
Compiler warnings and errors The previous two features (OOP model and strict data
typing) enable the authoring tool and compiler to provide compiler warnings and error
messages that help you find bugs in your applications faster than was previously possible in Flash.
When you use ActionScript 2.0, make sure that the publish settings for the FLA file specify ActionScript 2.0. This is the default for files created in Flash MX 2004 and Flash 8. However, if you open an older FLA file that uses ActionScript 1.0 and begin rewriting it in ActionScript 2.0, change the publish settings of the FLA file to ActionScript 2.0. If you don’t, your FLA file will not compile correctly, and errors won’t be generated.