User Guide

176 Display Programming
When Flash Player dispatches an event object, that event object makes a round-trip journey
from the Stage to the display object where the event occurred. For example, if a user clicks on
a display object named
child1, Flash Player dispatches an event object from the Stage
through the display list hierarchy down to the
child1 display object.
The event flow is conceptually divided into three phases, as illustrated in this diagram:
For more information, see Chapter 13, “Handling Events,” on page 345.
Basics for working with the core display
classes
The sections that follow provide a starting point for working with the core display classes in
ActionScript 3.0. These sections provide only an overview of these topics. For more details,
see the sections describing the applicable classes in the ActionScript 3.0 Language Reference.
Drawing vector graphics
Each Shape, Sprite, and MovieClip object has a graphics property. The graphics property
for each of these objects is a Graphics object, and the Graphics class includes properties and
methods for drawing and manipulating lines, fills, and shapes.
For example, the following code draws an orange circle in a Shape object:
import flash.display.*;
var circle:Shape = new Shape()
var xPos:Number = 100;
var yPos:Number = 100;
var radius:Number = 50;
circle.graphics.beginFill(0xFF8800);
circle.graphics.drawCircle(xPos, yPos, radius);
this.addChild(circle);
Stage
Parent Node
Child1 Node
Child2 Node
Capture
Phase
Bubbling
Phase
Target Phase