Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (32.77 KB, 3 trang )
< Day Day Up >
Components: A Scripting Primer
Because the focus of this book is ActionScript, our discussion in this lesson largely
centers on how to work with and use Flash components from a scripting standpoint. For a
more thorough overview of components, consult the documentation that comes with
Flash.
A component is usually nothing more than a movie clip with some built-in functionality.
Components can be customized using ActionScript in two ways:
•
You add components to a project manually by dragging them onto the stage within
Flash's authoring environment, via the Property Inspector or Component Inspector.
•
You add components to a project dynamically using ActionScript while the movie
plays.
When a component is added by either technique, you're actually placing an instance of
that component type/class into your project. For example, if you drag and drop a
CheckBox component onto the stage in the authoring environment, that object is
considered to be a CheckBox component instance. As when using other object instances,
you assign names to component instances; the instance name can be used in your scripts
to communicate with that component instance.
A number of user interface components ship with Flash. These components allow you to
create forms and menus, or to display information and visual content in interactive ways.
Flash also ships with data components and media components. Data components provide
a relatively easy way of working with the data in your application, especially sending and
retrieving external data. Media components enable you to display and control the
playback of media elements such as video and MP3 files. The primary focus of this
lesson involves using and working with user interface components. You'll learn about
media element component types in later lessons.