Drop Down Menu V3 XML
Properties | Methods | Events | Styles | XML
view a Basic XML sample file (with minimum data to build a menu)
view a Advanced XML sample file (with styles, complex data and parameters) V3 Component XML standard files you can hold and set the following data:
- component properties
- xml data used by the component
- style data
<item title="Home" url="http://www.jumpeyecomponents.com" />
Properties tag / Component propertiesAll properties that can be set from Component Inspector, can also be set with this V3 XML type of file.
You can also set properties for the component that are standard MovieClip (or other extended class) properties, such as _x, _width, _xscale, _alpha, etc for AS2 or x, width, scaleX, alpha, etc for AS3. All properties has to be declared like in the following example:
Data tagIn order to build the desired menu, the menu structure needs to be defined in the XML file, using the <data> tag. The <data> tag will contain the <main> tag which contains the main menus as items (using the <item> tag); Those folder type menus that have childNodes will have their own <item> childNodes following this structure:
The <main> tag may have the following attributes:
childStyle - the style that his childNodes will inherit in case they don't have their own style (optional) (you can also use the style attribute instead, even if it is interpreted only by its childNodes, since the main node has no visual reference, no applicable style)
The <item> tag may have the following attributes:
title - the text that will be shown in the menu item
icon - the icon of the menu item (optional)
style - the style of the item (optional)
childStyle - the style that his childNodes will inherit in case they don't have their own style (optional)
isEnabled - if the menu item is enabled(true) or disabled(false) (optional)
itemHeight - optional style parameter that can override the general style itemHeight parameter, this can be used to adjust the size of an item, in case it uses the same style
URL METHOD ATTRIBUTES
url - a url address to be followed when user clicks on the menu (optional)
target - the url target (optional)
- the function with brackets and params, its path by dot notation like in eg.: myFunc(param1,param2) (optional)
any other attributes can be inserted here. You will have access to them from the item itself with dot notation
Style tagAll styles should be declared inside the XML that feeds the component under the node <styles>, in separate nodes using the name that will be used in the data node when using styles. E.g. <myStyleName> or <style1> A style node may contain some nodes that will be used for configuring all states, while it also have a <states> node, containing all/or some of the states allowed for the skin. The <style> node may contain the following child nodes
The value of the node should be the linkage id of the movieclip used for the icon of a parent node
This style is used only in horizontal orientation mode.
The distance between the beginning of the movieclip item and the place where the text begins, a distance that will be used only if an icon will be displayed in the place, only if the icon attribute of the item node is set.
This style is used only in pop menus (main vertical mode and on all submenus).
The distance between the beginning of the movieclip item and the place where the text begins, a distance that will be used to display an icon.
Boolean, if true the menu size (width) will be taken from the size of the movieclip; if false, the size will be taken from the text size (the longest text size)
The value of the node should be a number that will be used for sizing the height of an item
The value will be used for spacing between icon and text inside a icon, and where spacing is needed
The node has exactly the same structure of a TextFormat Class but in XML format, all its childNodes will be added to the menu item TextField as TextFormat properties.
The node may will contain a child node for each possible state, however, you can omit states, you can simply define only the mandatory <up> state and it will be used for all others in base of the state substitution order.
The possible states are the following:<parts>
<expanded_selected>Every state may contain the following child nodes: <textFormat>
This OPTIONAL node has exactly the same structure of a TextFormat Class but in XML format, all its childNodes will be added to the menu item TextField as TextFormat properties. It overrides the general textFormat for a speciffic state. <mcLinkageId>
The linkage id of the movieclip that will be loaded as a specific state of the menu item. This movieclip have to be found inside the flash library.
The node may will contain a child node for each possible part (top, botton, lef, right, vertical and horizontal separators). All these nodes link to movieclips that will be loaded from the library.
Horizontal menu style (main menubar)
Vertical menu style (main vertical menu and all submenus)
Properties | Methods | Events | Styles | XML