Skip to Main Content
Learning ActionScript 3.0, 2nd Edition
book

Learning ActionScript 3.0, 2nd Edition

by Zevan Rosser, Rich Shupe
October 2010
Beginner content levelBeginner
453 pages
15h 52m
English
O'Reilly Media, Inc.
Content preview from Learning ActionScript 3.0, 2nd Edition

Chapter 3. Properties, Methods, and Events

IN THIS CHAPTER

Jump Right In

Properties

Events

Methods

Event Propagation

Frame and Timer Events

Removing Event Listeners

What’s Next?

In addition to the core language fundamentals reviewed in the previous chapter, you will find that the majority of your scripts are written using properties, methods, and events. These are the basic building blocks of most scripted tasks and allow you to get and set characteristics of, issue instructions to, and react to input from, many assets.

This is what we’ll be covering in this chapter:

  • Jump Right In. Get your feet wet right away by starting the chapter with a simple practical example. Adapt the Hello World! example by conveying your greeting one character at a time.

  • Properties. Properties are somewhat akin to adjectives, in that they describe the object being modified or queried. For example, you can check or set the width of a button. Most properties are read-write, in that you can both get and set their values. Some properties, however, are read-only, which means you can ask for, but not change, their values.

  • Events. Events are the catalysts that trigger the actions you write, setting properties and calling methods. For instance, a user might click the mouse button, which would then result in a mouse event. If you write code to react when that event is detected, the event can then cause a function to execute performing the desired actions.

  • Methods. Methods are a bit like verbs. They tell objects to do something, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning ActionScript 3.0

Learning ActionScript 3.0

Rich Shupe, Zevan Rosser
ActionScript 3.0 Cookbook

ActionScript 3.0 Cookbook

Joey Lott, Darron Schall, Keith Peters
ActionScript 3.0 Bible

ActionScript 3.0 Bible

Roger Braunstein

Publisher Resources

ISBN: 9781449398705Supplemental ContentErrata Page