background preloader

Programming

Facebook Twitter

Game Engine Technology by Unreal. ShiVa 3D Game engine with development tools. Adobe ActionScript 3.0 * Core display classes. The ActionScript 3.0 flash.display package includes classes for visual objects that can appear in Flash Player or AIR.

Adobe ActionScript 3.0 * Core display classes

The following illustration shows the subclass relationships of these core display object classes. The illustration shows the class inheritance of display object classes. Note that some of these classes, specifically StaticText, TextField, and Video, are not in the flash.display package, but they still inherit from the DisplayObject class. All classes that extend the DisplayObject class inherit its methods and properties. For more information, see Properties and methods of the DisplayObject class. You can instantiate objects of the following classes contained in the flash.display package: Bitmap—You use the Bitmap class to define bitmap objects, either loaded from external files or rendered through ActionScript.

Adobe ActionScript 3.0 * Event listeners. The creation of listener functions is one area where the ActionScript 3.0 event model deviates from the DOM event model.

Adobe ActionScript 3.0 * Event listeners

In the DOM event model, there is a clear distinction between an event listener and a listener function: an event listener is an instance of a class that implements the EventListener interface, whereas a listener function is a method of that class named handleEvent(). In the DOM event model, you register the class instance that contains the listener function rather than the actual listener function. In the ActionScript 3.0 event model, there is no distinction between an event listener and a listener function. ActionScript 3.0 does not have an EventListener interface, and listener functions can be defined outside a class or as part of a class. Moreover, listener functions do not have to be named handleEvent()—they can be named with any valid identifier.

Listener function defined outside of a class Notice that the event object is passed as an argument to clickHandler(). Adobe ActionScript 3.0 * Exporting library symbols for ActionScript. By default, instances of movie clip symbols in a Flash document’s library cannot be dynamically created (that is, created using only ActionScript).

Adobe ActionScript 3.0 * Exporting library symbols for ActionScript

This is because each symbol that is exported for use in ActionScript adds to the size of your SWF file, and it’s recognized that some symbols might not be intended for use on the stage. For this reason, in order to make a symbol available in ActionScript, you must specify that the symbol should be exported for ActionScript. To export a symbol for ActionScript: Select the symbol in the Library panel and open its Symbol Properties dialog box.If necessary, activate the Advanced settings.In the Linkage section, activate the Export for ActionScript checkbox.This will activate the Class and Base Class fields.By default, the Class field is populated with the symbol name, with spaces removed (for example, a symbol named “Tree House” would become “TreeHouse”).

Adobe ActionScript 3.0 * Basics of user input. User interaction, whether by keyboard, mouse, camera, or a combination of these devices, is the foundation of interactivity.

Adobe ActionScript 3.0 * Basics of user input

In ActionScript 3.0, identifying and responding to user interaction primarily involves listening to events. The InteractiveObject class, a subclass of the DisplayObject class, provides the common structure of events and functionality necessary for handling user interaction. You do not directly create an instance of the InteractiveObject class. Instead, display objects such as SimpleButton, Sprite, TextField, and various Flash authoring tool and Flex components inherit their user interaction model from this class and therefore share a common structure.

This means that the techniques you learn and the code you write to handle user interaction in an object derived from InteractiveObject are applicable to all the others. The following typical user interaction tasks are described in this chapter: Game Engine. ActionScript® 3.0 Reference for the Adobe® Flash® Platform. The ActionScript® 3.0 Reference for the Adobe® Flash® Platform contains the ActionScript language elements, core libraries, and component packages and classes for the tools, runtimes, services and servers in the Flash Platform.

ActionScript® 3.0 Reference for the Adobe® Flash® Platform

Filter by product using the preset filters This reference combines the information about the ActionScript language elements and libraries for the following Adobe products and runtimes. Click on a product name below to filter this reference to show only the content for the latest version of that product and related runtimes: Filter by product using the filter controls.