Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy 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
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / ActionScript Technology Center /

ActionScript 3 Cookbook excerpts: From custom classes to the rendering model

by Joey Lott, Darron Schall, Keith Peters

Joey Lott, Darron Schall, Keith Peters
  • O'Reilly Media

Created

19 February 2007

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
ActionScriptarraysdisplay listFlash PlayerFlash ProfessionalFlex BuilderOOP
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

Requirements

User level

Intermediate

Required products

  • Flash Professional CS3 (Download trial)
  • Flex Builder 2 (Download trial)

Well before Ajax and Microsoft Windows Presentation Foundation, Macromedia Flash provided the first method for building "rich" web pages. Now that Flash is a full-fledged development environment, learning ActionScript 3 is key—a challenge for even the most experienced Flash developer.

The following book excerpts include Chapters 1, 2, 3, 5, and 6 from ActionScript 3 Cookbook by Joey Lott, Darron Schall, and Keith Peters, published by O'Reilly Media. This book offers more than 300 solutions to solve a wide range of coding dilemmas so you can learn to work with the new version right away.

This book is written with all levels of ActionScript developers in mind—people like you who want practical solutions to common problems. It contains many accessible and practical examples, solutions, and insights into the situations that Flash and ActionScript developers are sure to encounter. Each recipe presents a problem, a solution, and a discussion of the solution. You can quickly locate the recipe that most closely matches your situation and get the solution without having to read the whole book to understand the underlying code. The book helps you understand the concepts by applying them in real situations. You'll even learn how to link modular ActionScript pieces together to create rock-solid solutions for Flex 2 and Flash applications.

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.

ActionScript 3 Cookbook © 2006 Joey Lott, Darron Schall, and Keith Peters. Reproduced by permission of O'Reilly Media Inc. All rights reserved.

ActionScript basics

Chapter 1 covers basic programming tasks such as using looping statements, timers, and more. It discusses the frequent goals and problems that relate to core usage. These recipes can help you handle situations that arise in every ActionScript 3 project. This chapter includes instructions on getting started with Flex Builder 2, setting up an ActionScript project, and writing code for your first application. It provides a useful glossary of terms and includes information on how to trace messages, handle events, and perform actions conditionally as well as outlining best practices for creating reusable code.

Download the complete chapter:

Chapter 1: ActionScript basics (PDF, 480K)

Custom classes

Chapter 2 dives into writing custom classes with ActionScript 3. The core focus of ActionScript 3 is using classes as building blocks. You can create packages to organize your custom classes into groups. When using Flex 2, all ActionScript code is placed within a class. This chapter provides invaluable information about how to name and save your custom classes, as well as creating subclasses, methods, and properties. It also covers how to dispatch events. Learning how to create custom classes is integral to ActionScript 3—and it's the next big step to expanding your application development skills.

Download the complete chapter:

Chapter 2: Custom classes (PDF, 244K)

Runtime environment

Chapter 3 takes an in-depth look at the runtime environment in Flash Player 9. This chapter covers how to get information about the operating system, device, and Flash Player version in use, as well as discussing important security functions. Ensure that your application appears as expected by programmatically detecting display settings and scaling the content. Change alignment of the SWF, determine the user's audio and video playback capabilities, and even prompt the user to change their Flash Player settings. This chapter also includes information related to loading external content into your application from another domain.

Download the complete chapter:

Chapter 3: Runtime environment (PDF, 268K)

Arrays

Chapter 5 discusses working with indexed collections of data, called arrays. Every aspect of using arrays is covered, from adding and removing elements to sorting. Arrays are very powerful and allow you to group related data together, which can then be accessed and displayed within your application when desired. This chapter describes both associative and integer-indexed arrays. ActionScript even allows you to store different data types in a single array—unlike other programming languages. This chapter can help you get started using arrays, including looping through an array, searching for matching elements, randomizing the elements in an array, and implementing custom sorting of data.

Download the complete chapter:

Chapter 5: Arrays (PDF, 404K)

Display list

Chapter 6 describes the new rendering model for ActionScript 3 and Flash Player 9—which differs radically from the previous versions. This chapter focuses on using display objects to control the visual data shown on the screen. The new rendering model is still hierarchical, but is much more flexible and uses the display list concept and the classes available in the flash.display package. Each SWF now contains one display list, which is comprised of three types of elements: the Stage, display object containers, and display objects. Transitioning to the display list offers many benefits for developers, including increased performance, easier depth management, and less rigid structure. It also provides a much simpler process for creating visual items programmatically.

Chapter 6: Display list (PDF, 528K)

More Like This

  • Six reasons to use ActionScript 3.0
  • Creating a preloader in Flash
  • Introduction to event handling in ActionScript 3.0
  • ActionScript 3 Design Patterns excerpt: Factory method and MVC
  • Essential ActionScript 3 excerpt: Display and interactivity
  • ActionScript 3.0 overview
  • Flash iOS Apps Cookbook excerpt: ActionScript optimization
  • Introduction to Robotlegs – Part 3: Services
  • Introduction to Robotlegs – Part 2: Models
  • ActionScript 3.0 from the ground up

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

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 © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement