Detailed instructions for use are in the User's Guide.
Components Language Reference
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: Evelyn Eldridge, Mary Ferguson, Mary Kraemer, Jessie Wood 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
Chapter 1: Components Dictionary . . . . . . . . . . . . . . . . . . . . . . . . 29 Types of components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Other listings in this chapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Chapter 2: Accordion component (Flash Professional only) . . . 35 Using the Accordion component (Flash Professional only) . . . . . . . . 36 Customizing the Accordion component (Flash Professional only) . . 40 Accordion class (Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . .47 Accordion.change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Accordion.createChild() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Accordion.createSegment() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Accordion.destroyChildAt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 Accordion.getChildAt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Accordion.getHeaderAt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Accordion.numChildren . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Accordion.selectedChild. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Accordion.selectedIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Chapter 3: Alert component (Flash Professional only) . . . . . . . 65 Using the Alert component (Flash Professional only) . . . . . . . . . . . . . 66 Customizing the Alert component (Flash Professional only) . . . . . . . .67 Alert class (Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Alert.buttonHeight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 Alert.buttonWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 Alert.CANCEL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Alert.cancelLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 Alert.click . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 Alert.NO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Alert.noLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Alert.NONMODAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Alert.OK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Alert.okLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Alert.show() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Alert.YES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Alert.yesLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87
3
Chapter 4: Button component . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 Using the Button component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Customizing the Button component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Button class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 Button.icon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Button.label. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Button.labelPlacement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Chapter 5: CellRenderer API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Understanding the List class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Using the CellRenderer API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 CellRenderer.getCellIndex() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 CellRenderer.getDataLabel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119 CellRenderer.getPreferredHeight() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 CellRenderer.getPreferredWidth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 CellRenderer.listOwner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 CellRenderer.owner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 CellRenderer.setSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 CellRenderer.setValue(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Chapter 6: CheckBox component . . . . . . . . . . . . . . . . . . . . . . . . 129 Using the CheckBox component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Customizing the CheckBox component. . . . . . . . . . . . . . . . . . . . . . . . . 132 CheckBox class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 CheckBox.click . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 CheckBox.label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 CheckBox.labelPlacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 CheckBox.selected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Chapter 7: Collection interface (Flash Professional only) . . . . . 147 Collection class (Flash Professional only) . . . . . . . . . . . . . . . . . . . . . . . 147 Collection.addItem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Collection.contains() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Collection.clear() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Collection.getItemAt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151 Collection.getIterator() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Collection.getLength() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Collection.isEmpty() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Collection.removeItem(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
4
Contents
Chapter 8: ComboBox component . . . . . . . . . . . . . . . . . . . . . . . . 157 Using the ComboBox component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .159 Customizing the ComboBox component . . . . . . . . . . . . . . . . . . . . . . . .162 ComboBox class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165 ComboBox.addItem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 ComboBox.addItemAt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 ComboBox.change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 ComboBox.close() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 ComboBox.close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 ComboBox.dataProvider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 ComboBox.dropdown. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 ComboBox.dropdownWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 ComboBox.editable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 ComboBox.enter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 ComboBox.getItemAt(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182 ComboBox.itemRollOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183 ComboBox.itemRollOver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185 ComboBox.labelField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .186 ComboBox.labelFunction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 ComboBox.length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 ComboBox.open() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 ComboBox.open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .189 ComboBox.removeAll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...