Accessibility
 
Home / Developer Center / Macromedia Flash Developer Center /

Macromedia Flash Article

Icon or Spacer Icon or Spacer Icon or Spacer
Gregory P. Burch
 
Gregory P. Burch
gburch@squarelabs.com
 

Extending components in Macromedia Flash MX

With the release of Macromedia Flash MX, developers have a new tool: components. A component is similar to what a Smart Clip was in Macromedia Flash 5 but much more powerful. Components make for faster development time, better code reuse, and for the designers, easier implementation of complex controls.

To learn more about components and what they are, read Extending components: Customizing the ListBox component by Nigel Pegg.

 

 

This article will cover the following topics:

·
Why should you extend a component?
·
Extending a component through several different methods
·
Component class hierarchy
·
Best practices for the naming of Classes, Methods, and component symbols
·
How to organize the code and symbols in your library
·
How to subclass (extend) a component
 

Sample files
This article refers to specific files throughout the instructions, such as the XFTree component, which is an extension of the FTree component. The XFTree component enables the FTree component to work with XML as the input and output for the tree structure down to the node level. Download these sample files to follow along and see the example application and component code:
Windows   Macintosh
Download the sample file fmx_components.zip (363K)   Download the sample file fmx_components.sit (315K)

Prerequisites
Fulfill the following prerequisites before proceeding. This article will touch on more advanced topics of Object Oriented Programming (OOP). You should be familiar with concepts in the following areas, and know how to implement them in Macromedia Flash:

·
Object oriented programming (the concepts)
·
Creating classes
·
Method overriding
·
Inheritance
·
Using callbacks
 
Table of contents
·
Increase functionality by extending components
·
What are the #initclip and #endinitclip actions?
·
How to extend a component using callbacks
·
Using inheritance to extend components
·
Working with nodes
 
  Next

About the author

Gregory P. Burch is a Flash Engineer currently working at Macromedia Inc. Greg has extensive Flash development experience with desktop and device applications and is an active developer on both. Located in Boston, MA.Greg is an active contributor to the Flash-Device community with contributions in several forms to the following books: Author - "Flash Design for Mobile Devices", Technical Editor - "Flash Enabled : Flash Design and Development for Devices", Source - "Flash the Future" (forthcoming).