|
|
||||||||||
| Ultrashock Tutorials > Flash MX 2004 > Introduction to the v2 component architecture | ||||||||||
|
||||||||||
|
|
Introduction to the v2 component architecture |
|
||||||||
Additions to the Public APIProperties In addition to all the UIObject properties your component will support, there are some other properties to accommodate the additional functionality in the UIComponent class. enabled The enabled property will allow your component to support an enabled/disabled state. The enabled property is a Boolean value. Once set the component is invalidated and the new value is available to the draw() function. In the draw() function you would ensure the state of your component visually reflects the value of the enabled property. <example>
private function draw():Void
{
if(enabled)
{
//make sure the component looks enabled
}
else
{
//make sure the component looks disabled
}
}
</example>
tabIndex The tabIndex property is used by the focus manager in obtaining the tab order for a component. Methods getFocus() This will retrieve the current focused object by the focus manager. setFocus() This will set the focus to your class. You can override this method in your component. By default the implementation calls Selection.setFocus(this). Utility Methods getFocusManager() The focus manger is what handles all focus management in the V2 framework. Before V2, we relied heavily on the player for managing focus issues. Because the built-in player focus management is not sophisticated enough to handle certain needs, the focus manager exists. Most of the time you will not need to do anything special for the focus manager to do is job. Documentation on some of the capabilities of the focus manager can be found in the Macromedia Help Documentation. The getFocusManager() is a convenient way of getting a reference to the Focus Manager. Events
|
||||||||||
©2004 Ultrashock.com - All rights reserved |