|
5 600 brands
1 870 000 user's guides |
|
|
|||||||||||||||
|
Search a brand
Advanced Search
|
Our partners wish to propose you the following products
|
User manual MACROMEDIA FLASH 8 - USING COMPONENTS
Diplodocs help download the user guide MACROMEDIA FLASH 8 - USING COMPONENTS.
Preview of the first 3 pages of manual
You either have JavaScript turned off or an old version of Adobe Flash Player Get the latest Flash Player.
User guide MACROMEDIA FLASH 8 - USING COMPONENTS
Detailed instructions for use are in the User's Guide. Using Components
Trademarks 1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central, ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite, FlashPaper, Flash Video Encoder, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally. Third-Party Information This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia endorses or accepts any responsibility for the content on those third-party sites. Speech compression and decompression technology licensed from Nellymoser, Inc. (www.nellymoser.com). SorensonTM SparkTM video compression and decompression technology licensed from Sorenson Media, Inc. Opera ® browser Copyright © 1995-2002 Opera Software ASA and its suppliers. All rights reserved. Macromedia Flash 8 video is powered by On2 TrueMotion video technology. © 1992-2005 On2 Technologies, Inc. All Rights Reserved. http://www.on2.com. Visual SourceSafe is a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries. Copyright © 2005 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced, translated, or converted to any electronic or machine-readable form in whole or in part without written approval from Macromedia, Inc. Notwithstanding the foregoing, the owner or authorized user of a valid copy of the software with which this manual was provided may print out one copy of this manual from an electronic version of this manual for the sole purpose of such owner or authorized user learning to use such software, provided that no part of this manual may be printed out, reproduced, distributed, resold, or transmitted for any other purposes, including, without limitation, commercial purposes, such as selling copies of this documentation or providing paid-for support services. Acknowledgments Project Management: Sheila McGinn Writing: Bob Berry, Jen deHaan, Peter deHaan, David Jacowitz, Wade Pickett Managing Editor: Rosana Francescato Lead Editor: Lisa Stanziano Editing: Mary Ferguson, Mary Kraemer, Lisa Stanziano Production Management: Patrice O'Neill, Kristin Conradi, Yuko Yagi Media Design and Production: Adam Barnett, Aaron Begley, Paul Benkman. John Francis, Geeta Karmarkar, Masayo Noda, Paul Rangel, Arena Reed, Mario Reynoso Special thanks to Jody Bleyle, Mary Burger, Lisa Friendly, Stephanie Gowin, Bonnie Loo, Nivesh Rajbhandari, Mary Ann Walsh, Erick Vera, the beta testers, and the entire Flash and Flash Player engineering and QA teams. First Edition: September 2005 Macromedia, Inc. 601 Townsend St. San Francisco, CA 94103
Contents
Intended audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 System requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 About the documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Typographical conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Terms used in this manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Additional resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Chapter 1: About Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 Installing components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Where component files are stored . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Modifying the component files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Benefits of using components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Component categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 About version 2 component architecture . . . . . . . . . . . . . . . . . . . . . . . . . 17 Version 2 component features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 About compiled clips and SWC files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Accessibility and components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Chapter 2: Creating an Application with Components (Flash Professional Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 About the Fix Your Mistake tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Build the main page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Bind data components to display gift ideas . . . . . . . . . . . . . . . . . . . . . . 29 Display gift details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Create the checkout screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Test the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 Viewing the completed application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
3
Chapter 3: Working with Components. . . . . . . . . . . . . . . . . . . . . .49 The Components panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Adding components to Flash documents . . . . . . . . . . . . . . . . . . . . . . . . 50 Components in the Library panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Setting component parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Sizing components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Deleting components from Flash documents . . . . . . . . . . . . . . . . . . . . . 57 Using code hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Creating custom focus navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Managing component depth in a document . . . . . . . . . . . . . . . . . . . . . . 59 Components in Live Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Using a preloader with components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 About loading components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Upgrading version 1 components to version 2 architecture . . . . . . . . . 62 Chapter 4: Handling Component Events . . . . . . . . . . . . . . . . . . . .63 Using listeners to handle events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Delegating events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 About the event object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Using the on() event handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Chapter 5: Customizing Components . . . . . . . . . . . . . . . . . . . . . . 81 Using styles to customize component color and text . . . . . . . . . . . . . . 82 About skinning components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 About themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Combining skinning and styles to customize a component . . . . . . . . . 118 Chapter 6: Creating Components . . . . . . . . . . . . . . . . . . . . . . . . . 125 Component source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Overview of component structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Building your first component. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Selecting a parent class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Creating a component movie clip. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Creating the ActionScript class file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Incorporating existing components within your component . . . . . . . 173 Exporting and distributing a component . . . . . . . . . . . . . . . . . . . . . . . . 182 Final steps in component development . . . . . . . . . . . . . . . . . . . . . . . . . 185
4
Contents
Chapter 7: Collection Properties . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Defining a collection property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Simple collection example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .189 Defining the class for a collection item . . . . . . . . . . . . . . . . . . . . . . . . . . 191 Accessing collection information programmatically . . . . . . . . . . . . . . . 191 Exporting components that have collections to SWC files . . . . . . . . .194 Using a component that has a collection property . . . . . . . . . . . . . . . .194 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Contents
5
6
Contents
Introduction
Macromedia Flash Basic 8 and Macromedia Flash Professional 8 are the standard authoring tools for producing high-impact web experiences. Components are the building blocks for the Rich Internet Applications that provide these experiences. A component is a movie clip with parameters that are set during authoring in Macromedia Flash, and with ActionScript methods, properties, and events that allow you to customize the component at runtime. Components are designed to allow developers to reuse and share code, and to encapsulate complex functionality that designers can use and customize without using ActionScript. Components are built on version 2 of the Macromedia Component Architecture, which allows you to easily and quickly build robust applications with a consistent appearance and behavior. This book describes how to build applications with version 2 components. The related Components Language Reference describes each component's application programming interface (API). It includes usage scenarios and procedural samples for using the Flash version 2 components, as well as descriptions of the component APIs, in alphabetical order. You can use components created by Macromedia, download components created by other developers, or create your own components. This chapter contains the following sections:
Intended audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 System requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 About the documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Typographical conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Terms used in this manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Additional resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
7
Intended audience
This book is for developers who are building Flash applications and want to use components to speed development. You should already be familiar with developing applications in Flash and writing ActionScript. If you are less experienced with writing ActionScript, you can add components to a document, set their parameters in the Property inspector or Component inspector, and use the Behaviors panel to handle their events. For example, you could attach a Go To Web Page behavior to a Button component that opens a URL in a web browser when the button is clicked without writing any ActionScript code. If you are a programmer who wants to create more robust applications, you can create components dynamically, use ActionScript to set properties and call methods at runtime, and use the listener event model to handle events. For more information, see Chapter 3, "Working with Components," on page 49.
System requirements
Macromedia components do not have any system requirements in addition to Flash. Any SWF file that uses version 2 components must be viewed with Flash Player 6 (6.0.79.0) or later, and must be published for ActionScript 2.0 (you can set this through File > Publish Settings, in the Flash tab).
About the documentation
This document explains the details of using components to develop Flash applications. It assumes that you have general knowledge of Macromedia Flash and ActionScript. Specific documentation about Flash and related products is available separately. This document is available as a PDF file and as online help. To view the online help, start Flash and select Help > Using Components. For information about Macromedia Flash, see the following documents:
Using Flash Learning ActionScript 2.0 in Flash ActionScript 2.0 Language Reference Components Language Reference
8
Introduction
Typographical conventions
The following typographical conventions are used in this book:
Italic font indicates a value that should be replaced (for example, in a folder path).
Code font
indicates ActionScript code, including method and property names.
Code font italic
indicates a code item that should be replaced (for example, an ActionScript parameter).
Bold font indicates a value that you enter.
Terms used in this manual
The following terms are used in this manual:
at runtime
When the code is running in Flash Player. While you are working in the Flash authoring environment.
while authoring
Additional resources
For the latest information on Flash, plus advice from expert users, advanced topics, examples, tips, and other updates, see the Macromedia DevNet website at www.macromedia.com/ devnet, which is updated regularly. Check the website often for the latest news on Flash and how to get the most out of the program. For TechNotes, documentation updates, and links to additional resources in the Flash Community, see the Macromedia Flash Support Center at www.macromedia.com/support/ flash. For detailed information on ActionScript terms, syntax, and usage, see Learning ActionScript 2.0 in Flash and the ActionScript 2.0 Language Reference. For an introduction to using components, see the Macromedia On Demand Seminar, Using UI Components at www.macromedia.com/macromedia/events/online/ondemand/ index.html.
Additional resources
9
10
Introduction
CHAPTER 1
About Components
Macromedia Flash components are movie clips with parameters that allow you to modify their appearance and behavior. A component can be a simple user interface control, such as a radio button or a check box, or it can contain content, such as a scroll pane; a component can also be non-visual, like the FocusManager that allows you to control which object receives focus in an application. Components enable you to build complex Macromedia Flash applications, even if you don't have an advanced understanding of ActionScript. Rather than creating custom buttons, combo boxes, and lists, you can drag these components from the Components panel to add functionality to your applications. You can also easily customize the look and feel of components to suit your design needs. Components are built on version 2 of the Macromedia Component Architecture, which allows you to build robust applications, easily and quickly, with a consistent appearance and behavior. The version 2 architecture includes classes on which all components are based, styles and skins mechanisms that allow you to customize component appearance, a broadcaster/ listener event model, depth and focus management, accessibility implementation, and more.
When publishing version 2 components, you must set your publish settings to publish for ActionScript 2.0 (File > Publish Settings, Flash tab). The version 2 components will not run correctly if published using ActionScript 1.0.
NO T E
1
Each component has predefined parameters that you can set while authoring in Flash. Each component also has a unique set of ActionScript methods, properties, and events, also called an API (application programming interface), that allows you to set parameters and additional options at runtime. For a complete list of components included with Flash Basic 8 and Flash Professional 8, see "Installing components" on page 12. You can also download components built by members of the Flash community at the Macromedia Exchange at www.macromedia.com/cfusion/ exchange/index.cfm.
11
This chapter contains the following sections:
Installing components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Where component files are stored . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Modifying the component files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Benefits of using components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Component categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 About version 2 component architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 Version 2 component features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 About compiled clips and SWC files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Accessibility and components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Installing components
A set of Macromedia components is already installed when you start Flash for the first time. You can view them in the Components panel. Flash Basic 8 includes the following components:
Button component CheckBox component ComboBox component Label component List component Loader component NumericStepper component ProgressBar component RadioButton component ScrollPane component TextArea component TextInput component Window component
12
About Components
Flash Professional 8 includes the Flash Basic 8 components plus the following additional components and classes:
Accordion component (Flash Professional only) Alert component (Flash Professional only) Data binding classes (Flash Professional only) DateField component (Flash Professional only) DataGrid component (Flash Professional only) DataHolder component (Flash Professional only) DataSet component (Flash Professional only) DateChooser component (Flash Professional only) FLVPlayback Component (Flash Professional Only) Form class (Flash Professional only) Media components (Flash Professional only) Menu component (Flash Professional only) MenuBar component (Flash Professional only) RDBMSResolver component (Flash Professional only) Screen class (Flash Professional only) Slide class (Flash Professional only) Tree component (Flash Professional only) WebServiceConnector component (Flash Professional only) XMLConnector component (Flash Professional only) XUpdateResolver component (Flash Professional only)
To view the Flash Basic 8 or Flash Professional 8 components:
1. 2. 3.
Start Flash. Select Window > Components to open the Components panel if it isn't already open. Select User Interface to expand the tree and view the installed components.
You can also download components from the Macromedia Exchange at www.macromedia.com/exchange. To install components downloaded from the Exchange, download and install the Macromedia Extension Manager at www.macromedia.com/ exchange/em_download/ Any component can appear in the Components panel in Flash. Follow these steps to install components on either a Windows or Macintosh computer.
Installing components
13
To install components on a Windows-based or a Macintosh computer:
1. 2.
Quit Flash. Place the SWC or FLA file containing the component in the following folder on your hard disk:
In Windows: C:\Program Files\Macromedia\ Flash 8\language\Configuration\Components On the Macintosh: Macintosh HD/Applications/Macromedia Flash 8/Configuration/ Components (Macintosh)
3. 4.
Start Flash. Select Window > Components to view the component in the Components panel if it isn't already open.
Where component files are stored
Flash components are stored in the application-level Configuration folder.
F o r in format ion about t hese folde rs, se e " C o n f ig ur a ti o n f o ld ers i ns t a ll ed w it h F la s h " i n Getting Started with Flash.
N OT E
Components are installed in the following locations: Windows 2000 or Windows XP: C:\Program Files\Macromedia\ Flash 8\language\Configuration\Components Mac OS X: Macintosh HD/Applications/Macromedia Flash 8/Configuration/ Components
14
About Components
Modifying the component files
The source ActionScript files for components are located in:
Windows 2000 or Windows XP: C:\Program Files\Macromedia\Flash 8\language\ First Run\Classes\mx Mac OS X: Macintosh HD/Applications/Macromedia Flash 8/First Run/Classes/mx
The files in the First Run directory are copied to your Documents and Settings path when Flash is first lunched. The Documents and Settings paths are:
Windows 2000 or Windows XP: C:\Documents and Settings\username\Local settings\Application Data\Macromedia\Flash 8\language\Configuration\Classes\mx Mac OS X: Username/Library/Application Support/Macromedia/Flash 8/language/ Configuration/Classes/mx
When Flash starts, if a file is missing from the Document and Settings path, Flash copies it over from the First Run directory to your Documents and Settings path.
If you want to modify the source ActionScript files, modify the ones in the Documents and Settings path. If any of your modifications "break" a component, Flash will restore the original functionality when you close and relaunch Flash by copying the functional file from the First Run directory. However if you modify the files in the First run directory and that "breaks" a component, then you may need to reinstall Flash to restore the source files back to the functional ones.
N OT E
If you've added components, you'll need to refresh the Components panel.
To refresh the contents of the Components panel:
Select Reload from the Components panel menu.
To remove a component from the Components panel:
Remove the MXP or FLA file from the Configuration folder.
Modifying the component files
15
Benefits of using components
Components enable you to separate the process of designing your application from the process of coding. They also let you to reuse code, either in components that you create, or by downloading and installing components created by other developers. Components allow coders to create functionality that designers can use in applications. Developers can encapsulate frequently used functionality into components and designers can customize the look and behavior of components by changing parameters in the Property inspector or the Component inspector. Flash developers can use the Macromedia Exchange at www.macromedia.com/go/exchange to exchange components. By using components, you no longer need to build each element in a complex web application from scratch. You can find the components you need and put them together in a Flash document to create a new application. Components that are based on the version 2 architecture share core functionality such as styles, event handling, skinning, focus management, and depth management. When you add the first version 2 component to an application, there is approximately 25K added to the document that provides this core functionality. When you add additional components, that same 25K is reused for them as well, resulting in a smaller increase in size to your document than you may expect. For information about upgrading components, see "Upgrading version 1 components to version 2 architecture" on page 62.
Component categories
Components included with Flash fall into the following five categories (the locations of their ActionScript source files roughly correspond to these categories as well and are listed in parentheses):
Data components (mx.data.*) Data components allow you to load and manipulate information from data sources; the WebServiceConnector and XMLConnector components are data components.
The source files for the data components aren't installed with Flash. However, some of the supporting ActionScript files are installed.
NO T E
FLVPlayback component (mx.video.FLVPlayback) The FLVPlayback component lets you readily include a video player in your Flash application to play progressive streaming video over HTTP, from a Flash Video Streaming Service (FVSS), or from Flash Communication Server (FCS).
16
About Components
Media components (mx.controls.*) Media components let you play back and control streaming media; MediaController, MediaPlayback, and MediaDisplay are media components.
User interface components (mx.controls.*) User interface components (often referred to as "UI Components") allow you to interact with an application; for example, the RadioButton, CheckBox, and TextInput components are user interface controls.
Managers (mx.managers.*) Managers are nonvisual components that allow you to manage a feature, such as focus or depth, in an application; the FocusManager, DepthManager, PopUpManager, StyleManager, and SystemManager components are manager components.
Screens (mx.screens.*) The screens category includes the ActionScript classes that allow you to control forms and slides in Flash.
For a complete list of components, see Components Language Reference.
About version 2 component architecture
You can use the Property inspector or the Component inspector to change component parameters to make use of the basic functionality of components. However, if you want greater control over components, you need to use their APIs and understand a little bit about the way they were built. Flash components are built with version 2 of the Macromedia Component Architecture. Version 2 components are supported by Flash Player 6 (6.0.79.0) and later, and ActionScript 2.0. These components are not always compatible with components built using version 1 architecture (all components released before Flash MX 2004). Also, the original version 1 components are not supported by Flash Player 7. For more information, see "Upgrading version 1 components to version 2 architecture" on page 62.
Flash MX UI components have been updated to work with Flash Player 7 or later. These updated components are still based on version 1 architecture. You can download them from the Macromedia Flash Exchange at www.macromedia.com/go/v1_components.
N O TE
Version 2 components are included in the Components panel as compiled clip (SWC) symbols. A compiled clip is a component movie clip whose code has been compiled. Compiled clips cannot be edited, but you can change their parameters in the Property inspector and Component inspector, just as you would with any component. For more information, see "About compiled clips and SWC files" on page 19.
About version 2 component architecture
17
Version 2 components are written in ActionScript 2.0. Each component is a class and each class is in an ActionScript package. For example, a radio button component is an instance of the RadioButton class whose package name is mx.controls. For more information about packages, see "About packages" in Learning ActionScript 2.0 in Flash. Most UI components built with version 2 of the Macromedia Component Architecture are subclasses of the UIObject and UIComponent classes and inherit all properties, methods, and events from those classes. Many components are also subclasses of other components. The inheritance path of each component is indicated in its entry in the Components Language Reference.
The class hierarchy is also available as a FlashPaper file in the installation location: Flash 8\Samples and Tutorials\Samples\Components\arch_diagram.swf.
NO TE 18
All components also use the same event model, CSS-based styles, and built-in themes and skinning mechanisms. For more information on styles and skinning, see Chapter 5, "Customizing Components," on page 81. For more information on event handling, see Chapter 3, "Working with Components," on page 49. For a detailed explanation of the version 2 component architecture, see Chapter 6, "Creating Components," on page 125.
Version 2 component features
This section outlines the features of version 2 components (compared to version 1 components) from the perspective of a developer using components to build Flash applications. For detailed information about the differences between the version 1 and version 2 architectures for building components, see Chapter 6, "Creating Components," on page 125.
The Component inspector allows you to change component parameters while authoring in Macromedia Flash and Macromedia Dreamweaver. (See "Setting component parameters" on page 55.) The listener event model
allows listeners to handle events. (See Chapter 4, "Handling Component Events," on page 63.) Flash doesn't have a clickHandler parameter in the Property inspector, as there was in Flash MX; you must write ActionScript code to handle events.
Skin properties let you load individual skins (for example, up and down arrows or the check for a check box) at runtime. (See "About skinning components" on page 96.)
allow you to create a consistent look and feel across applications. (See "Using styles to customize component color and text" on page 82.)
About Components
CSS-based styles
Themes allow you to drag a predesigned appearance from the library onto a set of components. (See "About themes" on page 108.) The Halo theme is the default theme that the version 2 components use. (See "About themes"
on page 108.)
Manager classes
provide an easy way to handle focus and depth in a application. (See "Creating custom focus navigation" on page 58 and "Managing component depth in a document" on page 59.)
The base classes UIObject and UIComponent provide core methods, properties, and events
to components that extend them. (See "UIComponent class" and "UIObject class" in the Components Language Reference.)
Packaging as a SWC file
allows easy distribution and concealable code. See Chapter 6, "Creating Components," on page 125.
Built-in data binding is available through the Component inspector. For more information, see "Data Integration (Flash Professional Only)" in Using Flash.
using ActionScript 2.0 allows you to create unique namespaces, import classes as needed, and subclass easily to extend components. See Chapter 6, "Creating Components," on page 125 and the ActionScript 2.0 Language Reference.
Flash 8 has several features that are not supported by the v2 components, including 9slice (sometimes referred to as "scale-9"), FlashType, and bitmap caching.
N OT E
An easily extendable class hierarchy
About compiled clips and SWC files
A compiled clip is a package of precompiled Flash symbols and ActionScript code. It's used to avoid recompiling symbols and code that will not be changed. A movie clip can also be "compiled" in Flash and converted to a compiled clip. For example, a movie clip with a lot of ActionScript code that doesn't change often could be converted to a compiled clip. The compiled clip behaves just like the movie clip from which it was compiled, but compiled clips appear and publish much faster than regular movie clips. Compiled clips can't be edited, but they do have properties that appear in the Property inspector and the Component inspector. Components included with Flash are not FLA files--they are compiled clips (that have been packaged into compiled clip (SWC) files. SWC is the Macromedia file format for distributing components; it contains a compiled clip, the component's ActionScript class file, and other files that describe the component. For details about SWC files, see "Exporting and distributing a component" on page 182.
About compiled clips and SWC files
19
When you place a SWC file in the First Run/Components folder, the component appears in the Components panel. When you add a component to the Stage from the Components panel, a compiled clip symbol is added to the library.
To compile a movie clip:
Right-click (Windows) or Control-click (Macintosh) the movie clip in the Library panel, and then select Convert to Compiled Clip.
To export a SWC file:
Select the movie clip in the Library panel and right-click (Windows) or Control-click (Macintosh), and then select Export SWC File.
Flash Basic 8 and Flash Professional 8 continue to support FLA components.
NO T E
Accessibility and components
A growing requirement for web content is that it should be accessible; that is, usable for people with a variety of disabilities. Visual content in Flash applications can be made accessible to the visually impaired with the use of screen reader software, which provides a spoken audio description of the contents of the screen. When a component is created, the author can write ActionScript that enables communication between the component and a screen reader. When a developer uses that component to build an application in Flash, the developer uses the Accessibility panel to configure each component instance. Most components built by Macromedia are designed for accessibility. To find out whether a component is accessible, see its entry in the Components Language Reference. When you're building an application in Flash, you'll need to add one line of code for each component (mx.accessibility.ComponentNameAccImpl.enableAccessibility();), and set the accessibility parameters in the Accessibility panel. Accessibility for components works the same way as it works for all Flash movie clips. Most components built by Macromedia are also navigable by the keyboard. Each component's entry in the Components Language Reference indicates whether you can control the component with the keyboard.
20
About Components
If this document matches the user guide, instructions manual or user manual, feature sets, schematics you are looking for, download it now. Diplodocs provides you a fast and easy access to the user manual MACROMEDIA FLASH 8 - USING COMPONENTS. MACROMEDIA offer a product for which we do not have the user manual? Let us know what you are looking for: site Internet, histoire, actualité, filiales, site Internet, mode d'emploi, driver, avis des utilisateurs, meilleur prix des produits, forum d'assistance aux problèmes, annuaire des marques, annuaire des constructeurs, répertoire des marques, répertoire des constructeurs, site Internet de la marque, site Internet du constructeur Diplodocs allows you to download user manual MACROMEDIA FLASH 8 - USING COMPONENTS, user guide MACROMEDIA FLASH 8 - USING COMPONENTS, instructions MACROMEDIA FLASH 8 - USING COMPONENTS, owner's manual MACROMEDIA FLASH 8 - USING COMPONENTS, online manual MACROMEDIA FLASH 8 - USING COMPONENTS.Access web reviews MACROMEDIA FLASH 8 - USING COMPONENTS, , Software. |
![]() |
Include the add-on to download manuals from your site, forum or blog | ![]() |
Frequently Asked Questions | ![]() |
Contact Diplodocs team | ![]() |
Last searches Last additions |
![]() |
Sitemap | ![]() |
|||
| Brands starting with A B C D E F G H I J K L M N O P Q R S T U V W X Y Z # | |||||||||||||
|
|
Copyright © 2005 - 2008 - Diplodocs -
All Rights Reserved. Designated trademarks and brands are the property of their respective owners. |