Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / ActionScript Technology Center /

Essential ActionScript 3 excerpt: Display and interactivity

by Colin Moock

Colin Moock
  • moock.org

Created

4 September 2007

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
ActionScript display list events Flash Builder Flash Professional OOP

Requirements

User level

Intermediate

ActionScript 3 is a huge upgrade to the Adobe Flash programming language. The enhancements to ActionScript's performance, feature set, ease of use, cleanliness, and sophistication are considerable. Essential ActionScript 3 is a radically overhauled update to Essential ActionScript 2, focusing on the core language and object-oriented programming, as well as adding a deep look at the centerpiece of the new Flash Player API: display programming. The book covers new language features, such as the DOM-based event architecture, E4X, and namespaces—and includes real-world sample code.

The printed book is available through most major online and retail bookstores worldwide, and can be read online at Safari Books Online. For more information visit the O'Reilly store.

Essential ActionScript 3 © 2007 Colin Moock. Reproduced by permission of O'Reilly Media Inc. All rights reserved.

Display API and the display list

One of the primary activities of ActionScript programming is displaying things on the screen. Accordingly, the Flash platform provides a wide range of tools for creating and manipulating graphical content. These tools can be broken into two general categories:

Flash runtime display API: A set of classes for working with interactive visual objects, bitmaps, and vector content.

Ready-made user interface components: The Flex framework's UI component set, a sophisticated collection of customizable user-interface widgets built on top of the display API; and the Flash authoring tool's UI component set, a collection of user-interface widgets with a smaller file size, lower memory usage, and fewer features than Flex framework's UI component set.

The display API is built directly into all Flash runtimes and is, therefore, available to all SWF files. The display API is designed for producing highly customized user interfaces or visual effects, such as those often found in motion graphics and games. This chapter focuses entirely on the display API.

Download the complete chapter:

  • Chapter 20: Display API and the display list (PDF, 930K)

Events and display hierarchies

When ActionScript dispatches an event targeted at an object that is not part of a display hierarchy , that target is the sole object notified of the event. For example, when a Sound object's sound finishes playing, ActionScript dispatches an Event.COMPLETE event targeted at the associated SoundChannel object. The SoundChannel object is not part of a display hierarchy , so it is the sole object notified that the event occurred.

By contrast, when ActionScript dispatches an event targeted at an object that is part of a display hierarchy , that target and all of its display hierarchy ancestors are notified that the event occurred. For example, if a Sprite object contains a TextField object, and the user clicks the TextField object, both the TextField object (the event target) and the Sprite object (the event target's ancestor) are notified that the mouse click occurred.

ActionScript's hierarchical event dispatch system enables every display object container to register event listeners that handle events targeted at its descendant display objects. For example, a Sprite representing a dialog box might register a listener that handles mouse click events targeted at a nested "OK button" control. Or a Sprite representing a login form might register a listener that handles focus events targeted at nested input fields. This centralized architecture helps reduce code repetition, particularly for code that responds to user input events.

Download the complete chapter:

  • Chapter 21: Events and display hierarchies (PDF, 763K)

More Like This

  • Creating a preloader in Flash
  • Understanding the changes in the display API in ActionScript 3.0
  • ActionScript 3 Cookbook excerpts: From custom classes to the rendering model
  • ActionScript 3.0 Quick Reference Guide excerpts: Copy motion, display list, events, and migration
  • ActionScript 3 Design Patterns excerpt: Factory method and MVC
  • Tips for learning ActionScript 3.0
  • Developers and designers talk about migrating to ActionScript 3
  • Introduction to event handling in ActionScript 3.0
  • Learning ActionScript 3 excerpts: OOP overview, display list, and programmatic motion
  • Adobe Flash Platform ActionScript reference for RIA development

Tutorials & Samples

Tutorials

  • Flash iOS Apps Cookbook excerpt: ActionScript optimization
  • Introduction to Robotlegs – Part 3
  • Introduction to Robotlegs – Part 2
  • Introduction to Robotlegs – Part 1

Samples

  • ActionScript 3 samples for Flash Professional CS5

ActionScript Blog

More
06/09/2012 New Flash Tools: Flash Optimizer 2.3
06/09/2012 Flash Optimizer 2.3
05/27/2012 How to add an image to android gallery (CameraRoll) using adobe air
04/22/2012 ActionScript 3.0 BitmapData, Clone, and ColorTransform

ActionScript Cookbook

More
03/20/2012 PDF Portfolio Navigational TOC
02/29/2012 Embed Stage3D content inside Flex application components
02/13/2012 Randomize an array
02/09/2012 Using Camera with a MediaContainer instead of VideoDisplay

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement