User Guide
Table Of Contents
- Contents
- Working with Flash MX 2004
- Creating Basic Components in Flash MX 2004
- Creating Advanced Components in Flash MX 2004
- Contents
- About Creating components
- Writing the component’s ActionScript code
- Simple example of a class file
- General process for writing a class file
- Selecting a parent class
- Identifying the class, symbol, and owner names
- About the component instantiation life cycle
- Writing the constructor
- Specifying clip parameters
- Implementing the constructObject2() method
- Implementing the init() method
- Implementing the createChildren() method
- Implementing the commitProperties() method
- Implementing the measure() method
- Implementing the layoutChildren() method
- Implementing the draw() method
- Defining getters and setters
- Component metadata
- Defining component parameters
- Handling events
- Using the Event metadata
- About invalidation
- Skinning custom controls
- Adding styles
- Making components accessible
- Improving component usability
- Best practices when designing a component
- Using the ModalText example
- Troubleshooting
- Index

79
INDEX
A
accessibility, for custom components 71
ActionScript
classpath in Flash 9
writing for a new component 46, 47
applyProperties 52
AS 2.0 Class option, setting 25, 26, 28, 50
B
Bindable metadata keyword 60
C
ChangeEvent metadata keyword 60
children, layoutChildren() method 57
classes
and ActionScript 8
createClassObject() method 54
extending 49
extending subclasses 49
name, for custom component 50
selecting a parent class 48
className variable 50
classpath
changing 10
default in Flash 10
UserConfig directory and 10
clear() method 58
commitProperties() method 55
component class file code sample 47
components. See creating components
constructObject2() method 54
constructor, writing for a new component 52
createChildren() method 54
creating components
adding events 67
code sample for class file 47
component symbol 12
creating SWC files 18
event metadata 68
extending a class 49
process for writing ActionScript 47
selecting a class name 50
selecting a symbol name 50
using metadata statements 59
writing a constructor 52
custom components
ActionScript 46
adding styles 70
advanced overview 45
best practices 72
compound 42
constructObject2() method 54
constructors 52
creating 24
events 33
exporting from Flash 16
init() method 54
instantiating 20
keyboard events 36
metadata 59
mouse events 34
naming 12
packaging 12
properties 30
resizing 68
selecting a parent class 48
sizing 37
skinning 39
versioning 72
D
debugging SWC files 21
dispatchEvent() method 67
draw() method 58