first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Adobe ActionScript 3: Notes for “Beginners Guide to Getting Started with AS3 (Without Learning Flex)”; DisplayObject, Sprite, MovieClip, UIComponent

Article location:

http://senocular.com/flash/tutorials/as3withmxmlc/

The package declaration is new to ActionScript 3.0. It replaces the fully-qualified names for classes used in ActionScript 2.0. It follows that:

class mx.controls.Button { ... }

becomes

package mx.controls { class Button { .. } }

Extending Sprite is the basic technique for displaying an object in Flash using ActionScript 3. This is the form:

package { import flash.display.Sprite;

public class BareBones extends Sprite
{
}

}

For the reader who may care just a little about Flex MXML (or using ActionScript 3 to render display objects behind MXML), the importance of the UIComponent Class cannot be overestimated and should be included in the list classes quoted above… In fact, when programmatically generating objects for display in Flex containers, the UIComponent should be used instead the Sprite. The location of UIComponent in the Adobe® Flex™ 2.0.1 Language Reference:

http://livedocs.adobe.com/flex/201/langref/mx/core/UIComponent.html

It is important to stress that all vector drawing tasks are confined in the new Graphics class. The location of Graphics in the Adobe® Flex™ 2.0.1 Language Reference:

http://livedocs.adobe.com/flex/201/langref/
    flash/display/Graphics.html

The Adobe documentation states, “You cannot create a Graphics object directly from ActionScript code. If you call new Graphics(), an exception is thrown.” Instead, you obtain an instance of the Graphics class from Shape, Sprite, and MovieClip (or their respective subclasses like UIComponent of FlexSprite).

Unfortunately, this embed annotation does not declare support vector formats.

For more details, read “Tips for learning ActionScript 3.0” by Emmy Huang of Adobe here:

http://www.adobe.com/devnet/actionscript/
    articles/actionscript_tips.html
mod date: 2009-02-06T00:26:23.000Z