Contents

Introduction

Welcome to ActionScript 3.0

PART 1 GETTING THE FUNDAMENTALS

CHAPTER 1 ACCESSING AND MANIPULATING OBJECTS

Creating a New Project for ActionScript 3.0

Accessing Objects on the Stage

Sending Messages to the Output Panel

Working with Object Parameters

Wrapping Up

CHAPTER 2 DYNAMICALLY ADDING OBJECTS TO THE STAGE

Creating Named Library Assets

Introducing the Display Stack

Creating New Objects on the Stage

Messing with the Display Stack

Assigning Properties to Dynamically Created Instances

Working with Comments

Creating Comments

Working with Spaces

Wrapping Up

CHAPTER 3 WORKING WITH FUNCTIONS

Fundamentals of Functions

Accepting Values in Functions

Possible Errors when Working with Functions

Required Parameter Error

Type Mismatch Error

Returning Values from Functions

More about Parentheses (and Curly Braces)

Wrapping Up

CHAPTER 4 ACTIONSCRIPT AND MATH

Mathematical Operators

Addition and Subtraction

Addition or Concatenation?

Multiplication and Division

Modulo, the Operator Formerly Known as Long Division with Remainders

Variables and Combined Assignment Operators

Variables

Combined Assignment Operators

Increment and Decrement Operators

Order of Operations

Using Parentheses to Force Order

Summing up Math Operations

Wrapping Up

CHAPTER 5 CREATING EVENTS

Events: Explained

Creating a Mouse Event Handler

Adding Other Events

Wrapping Up

CHAPTER 6 USING TIMELINE SCRIPTING WITH MOUSE EVENTS

Explaining the Project

Controlling Timeline Playback

Stopping Playback

Seeking to a Specific Frame

Working with MovieClip Timelines

Using the Event Callback Object and Handling Scope

The Event Callback Object

Using the Event Callback Object

Shortcuts for gotoAndStop()

The Finished Example

Another e Example

Working with Simple Callback Functions

Wrapping Up

CHAPTER 7 CREATING TIMER AND FRAME EVENTS

Using the Timer Event

Stopping the Timer

Using the Enter Frame Event

Removing Event Listeners

When to Use Frame vs. Timer Events

Wrapping Up

PROJECT 1 COUNTDOWN CLOCK

Project Specification: Countdown Clock

Visual Design Review

Kick-Off Meeting Notes: Countdown Clock

Solution and Walkthrough: Countdown Clock

Project Setup in Flash Professional

ActionScript Setup

Auto-Generated Imports

Display Objects

Event Listener for the Start Button

Timer and Timer Event Listeners

Callback Function for Starting the Timer

Callback Functions for Timer Events

Wrapping Up

PART 2 EXPLORING THE BASICS OF CLASSES

CHAPTER 8 WHAT IS A CLASS?

Overview of a Class

Variables Revealed

Creating a Class

Wrapping Up

CHAPTER 9 BUILDING OUT THE CLASS

Parts of a Class

Package Statement

Import Statement

Class Statement

Class Constructor

Creating a Class Instance

Adding Constructor Parameters

Customizing the Button Label

Customizing Multiple Properties

Making Constructor Parameters Optional

Creating Methods

Accessing Methods from Outside the Class

Wrapping Up

CHAPTER 10 DOING MORE WITH CLASSES

What is the public Keyword for?

Restricting Access with private

Using Best Practices for Naming Private Members

Getters and Setters: Keeping Things Polite

Creating Getter and Setter Methods

Using the get and set Statements

Going Frame-Script-Free: Creating a Document Class

Creating an Initialization Method

Wrapping Up

CHAPTER 11 ORGANIZING YOUR CLASSES

Your Package Has Been Delivered

Creating a Package Folder

Referring to All Classes in a Package

Creating Nested Packages

Changing the Source Path

Wrapping Up

PART 3 RESPONDING TO CONDITIONS AND WORKING WITH LOGIC

CHAPTER 12 CONDITIONALS

Boolean Variables and Equality

Testing for Equality

Testing for Inequality

Demonstrating Equality and Inequality

Building Drag and Drop for the Mouse

Adding Feedback

Testing Conditions

The if Statement

The if...else Statement

The if...else if statement

Wrapping Up

CHAPTER 13 ADVANCED BOOLEAN LOGIC AND RANDOM NUMBERS

Using Logic Operators

The AND Operator

The OR Operator

The NOT Operator

Building Complex Conditionals

Generating Random Numbers

Wrapping Up

CHAPTER 14 WORKING WITH TEXT AND THE KEYBOARD

Working with Text Fields

Customizing the Text Style

Making Changes to Style Later on

Creating Your Own ActionScript Fonts

Creating the Quiz Layout

Working with Escape Sequences

Creating the KeyboardEvent Handler

Differences between Code Types: Key Codes versus Character Codes

Recognizing Special Keys

Wrapping Up

CHAPTER 15 CREATING GROUPS OF OBJECTS AND REPEATING ACTIONS USING LOOPS

What Are Loops?

Using the for Loop

Controlling the Flow of Loops with break and continue

Nesting Loops

Another Style of Loops, the do Loop

Creating Groups of Items with Arrays

Modifying an Array

Using Loops to Create Arrays

Looping through an Array

Wrapping Up

PROJECT 2 DICEOUT!

Project Specification: DiceOut

Visual Design Review: DiceOut

Kick-Off Meeting Notes: DiceOut

Solution and Walkthrough: DiceOut

Overview of the Document Class

Walkthrough of the Document Class

Wrapping Up

PART 4 GETTING CREATIVE WITH ACTIONSCRIPT

CHAPTER 16 DRAWING WITH ACTIONSCRIPT

Drawing and Code

Sprites: MovieClips without Timelines

Your First Shape

Extending the Sprite Class

Drawing Lines and Working with Strokes

Drawing Ahead of the Curve

Drawing Shapes

Using Fills

Building Gradients

Looping with the Drawing API

Wrapping Up

CHAPTER 17 ANIMATION USING ACTIONSCRIPT

ActionScript Animation = Location + Time

Moving an Object Using a Timer

Creating Random Animations

Animating Multiple Objects with Loops

Fine-Tuning Animations

Wrapping Up

CHAPTER 18 WORKING WITH EXTERNAL MEDIA

Using Images

Playing Audio from the Web

Playing Video from the Web

Altering the Playback of Video

Pausing Video

Rewind and Seek

Wrapping Up

PART 5 CREATING MULTI-SCREEN PROJECTS

CHAPTER 19 DESKTOP APPLICATIONS WITH ADOBE AIR

Getting Started

Working with Desktop Events

Minimize

Maximize

Drag

Close

Resize

Creating a Resizable Layout

Configuring Your AIR Project

Icons

Certificate

Publish and Install

Wrapping Up

CHAPTER 20 MOBILE APPLICATIONS WITH ADOBE AIR

Getting Started

Setting Up Your Testing Devices

Creating a Mobile Project

Your First Android Application

Your First iOS Application

Creating Interactions for Devices

Tip, Tap—Basic Touch Interactions

Simple Dragging with Touch

Taking Your Time with Long Touches

Working with Gesture Events

Pinch to Zoom

Rotate

Debugging over USB

Debugging on Android

Debugging on iOS

Optimizing Content

Wrapping Up

PROJECT 3 FLIPR

Project Specification: Flipr

Visual Design Review: Flipr

Kick-Off Meeting Notes: Flipr

Solution and Walkthrough: Flipr

Review of the Flash Professional Project

Review of the Document Class

Display the Splash Screen

Display the Main Controls

Create the Game Logic

Create the Game Board

Set Up the Score and Timer Displays

Set Up the Player Controls and Game Rules

Wrapping Up

APPENDIX A CONFIGURING YOUR MOBILE ENVIRONMENT

Setting Up an Android Device for Testing

Setting Up an iOS Device for Testing

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.131.99.14