Game Development Reference
In-Depth Information
for common tasks, and it is entirely possible (and encouraged) to
create new ones for custom objects like games. Events can carry
with them any amount of data pertinent to their type, but all of
them contain a few basic properties:
￿
A name or type
￿
A target: The object that dispatched the event
￿
A current target: The object that is currently listening to/
handling the event
Events are an extremely powerful tool that we will make extensive
use of in later chapters.
Packages
A package is a collection of classes and functions, used for organiza-
tion purposes. Because there are so many different classes built into
Flash, not to mention all the classes we will create, it is important to
keep them grouped into logical collections. For instance, any classes
in Flash that deal directly with display objects are in a package called
flash.display. Most events are found in the flash.events package. The
standard naming convention for a package is all lowercase. To use
classes in a particular package, we use the import command to gain
access to them:
package mypackage {
import flash.display.MovieClip;
public class MyClass() extends MovieClip {
}
}
Author Time, Compile Time, and Runtime
These terms refer to the different stages when data in Flash is altered
or verified. Throughout the topic, I will make reference to things that
happen inside the Flash-authoring environment
these are author-
time events. Events or errors that occur during the process in which
Flash creates a SWF file are known as compile-time events. Finally,
runtime events occur once a SWF is running by itself.
You Can Wake Up Now
Whew. You made it! Although you may not fully understand the
concepts I
ve presented here, you will start to see them in context
in later chapters and they will start to click. Just think, now you
can drop words like
'
polymorphism
in casual conversation and
sound like a full-fledged nerd, er
software engineer!
Search Nedrilad ::




Custom Search