MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 540

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Understanding the Menu component: view and data
Conceptually, the Menu component consists of a data model and a view that displays the data.
The Menu class provides the view and contains the visual configuration methods. The
MenuDataProvider class
DataProvider API does to the Array object); these methods let you externally construct data
providers and add them to multiple menu instances. The data provider broadcasts any changes to
all of its client views. (See
A Menu instance is a hierarchical collection of XML elements that correspond to individual menu
items. The attributes define the behavior and appearance of the corresponding menu item on the
screen. The collection is easily translated to and from XML, which is used to describe menus (the
tag) and items (the
menu
model underlying the Menu component.
A simple menu with two items can be described in XML with two menu item subelements:
<menu>
<menuitem label="Up" />
<menuitem label="Down" />
</menu>
Note: The tag names of the XML nodes (
their nesting relationships are used in the menu.
About hierarchical menus
To create hierarchical menus, embed XML elements within a parent XML element, as follows:
<menu>
<menuitem label="MenuItem A" >
<menuitem label="SubMenuItem 1-A" />
<menuitem label="SubMenuItem 2-A" />
</menuitem>
<menuitem label="MenuItem B" >
<menuitem label="SubMenuItem 1-B" />
<menuitem label="SubMenuItem 2-B" />
</menuitem>
</menu>
This converts the parent menu item into a pop-up menu anchor, so it does not generate events
when selected.
540
Chapter 6: Components Dictionary
adds methods to the global XML prototype object (much like the
"MenuDataProvider class" on page
tag). The built-in ActionScript XML class is the basis for the
menuitem
and
menu
568.)
) are not important; the attributes and
menuitem

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents