E-merald web-engineering Flash components
E-merald web-engineering Contact Site map
 
Home Components Support Purchase
Components

XML file structure

The structure of the Global Menu Pro component XML file enables you to configure parameters and styles on the following levels:

  1. Inside the <settings> element — all common parameters and styles (exactly the same as in the Component inspector).
  2. Inside those <item> nodes of the <items> element that describe top-level menu items — separate style declaration for each of top-level item and its submenus (overrides the parameters of the same name set inside the <settings> element).
  3. Inside each <item> node of the <items> element — some individual parameters concerning a single menu item (overrides the parameters of the same name set inside the <settings> element or through the separate style declaration).

Note: Setting a property in the XML file overrides the parameter of the same name set in the Component inspector. If the value of a property in the XML file is undefined (omitted), it will be ignored.

The basic template of the XML file (without separate style declaration):

Download a basic XML sample file

<?xml version="1.0" encoding="UTF-8"?>
<menu>
<settings>
<menuBar width="405" height="25" color1="F5F5F5" alpha1="100" color2="FFFFFF" alpha2="70" rounded="all"/>
<rectangleCornerRadius value="6"/>
<leftMargin value="0"/>
<itemHeight level1="22" level2="20"/>
<itemWidth level1="80" level2="120" level3="140" level4="140" level5="100"/>
<topLevelIcons enabled="true" size=""/>
<popupLevelIcons enabled="true" size=""/>
<tweenDuration rollover="0.2" sliding="0.3"/>
<fadeOut delay="0.4"/>
<shiftLeft basic="10" slide="40"/>
<glowFilter enabled="true"/>
<itemRollAnimation mode="1"/>
<fontFamily name="arial_embed"/>
<embedFonts enabled="true"/>
<fontSize level1="12" level2="11"/>
<fontColor level1="445C82" level2="FFFFFF"/>
<fontColorRollover level1="AFB2B6" level2="383838"/>
<fontColorSelected level2="DADEE9"/>
<fontColorDisabled level1="979797" level2="B1B4B8"/>
<fontWeight level1="normal" level2="normal"/>
<fontStyle level1="normal" level2="normal"/>
<textDecoration level1="none"/>
<textDecorationRollover level1="none"/>
<textAlign level1="left"/>
<textPaddingLevel1 top="" left=""/>
<textPaddingLevel2 top="" left=""/>
<backgroundLevel1 color1="FFFFFF" alpha1="0" color2="FFFFFF" alpha2="0" rounded="top"/>
<backgroundLevel1Rollover color="37383E" alpha="100"/>
<backgroundLevel2 color1="37383E" alpha1="100" color2="444444" alpha2="100" rounded="all"/>
<backgroundLevel2Rollover color="C0CCE3" alpha="100"/>
<backgroundLevel2Selected color="747A86" alpha="100"/>
</settings>
<items>
<item label="Audio">
<item label="Mixers">
<item label="Analog Mixers">
<item label="Soundcraft">
<item label="Live" action="getUrl" url="/audio/mixers/analog_mixers/soundcraft/live/" target="_self"></item>
</item>
</item>
</item>
</item>
</items>
</menu>

The advanced sample of the XML file (the fragment showing separate style declaration and individual parameters applied to a single menu item):

Download an advanced XML sample file

<items>
<item
label="Audio"
action=""
url=""
target=""
widthL1="65"
widthL2="145"
enabled=""
shiftLeftSlide="10"
itemL2Opened="3"
fontColorL1="FFFFFF"
fontColorL2=""
fontColorRolloverL1="F5D6D6"
fontColorRolloverL2=""
fontColorSelectedL2="FAEBEB"
fontColorDisabledL1=""
fontColorDisabledL2="CDBEB4"
bgL1Color1="EFB4B4"
bgL1Color2="C62C2B"
bgL1Alpha1="100"
bgL1Alpha2="100"
bgL1Rounded=""
bgL1RolloverColor="C62C2B"
bgL1RolloverAlpha="100"
bgL2Color1="C62C2B"
bgL2Color2="444444"
bgL2Alpha1="100"
bgL2Alpha2="100"
bgL2Rounded=""
bgL2RolloverColor="F5D6D6"
bgL2RolloverAlpha="100"
bgL2SelectedColor="F5D6D6"
bgL2SelectedAlpha="50"
>
<item label="Mixers" widthL3="150" fontColor="FF9933">
<item label="Analog Mixers" widthL4="130">
<item label="Soundcraft" widthL5="120">
<item label="Live" action="getUrl" url="/audio/mixers/analog_mixers/soundcraft/live/" target="_self"></item>
<item label="Multi-Purpose" enabled="false"></item>
</item>
</item>
</item>
</item>
</items>

The description of the XML file elements

1. The following table describes the attributes of nodes that the <settings> element contains:

Node
name
Attribute
name
Default Description
menuBar width 500 The width of the menu bar, in pixels.
  height 30 The height of the menu bar, in pixels.
  color1 "FFFFFF" The starting (top) color of the gradient fill of the menu bar background.
  alpha1 0 The starting (top) alpha transparency of the gradient fill of the menu bar background. Possible values: from 0 to 100.
  color2 "FFFFFF" The ending (bottom) color of the gradient fill of the menu bar background.
  alpha2 0 The ending (bottom) alpha transparency of the gradient fill of the menu bar background. Possible values: from 0 to 100.
  rounded "all" Specifies which corners of the menu bar to be drawn rounded. Possible values: "all", "left", "right", "top", "bottom", "none".
rectangleCornerRadius value 5 Specifies the corner radius for all background fills (rectangles), in pixels.
leftMargin value 0 The left margin of the menu, relative to the left edge of the menu bar, in pixels.
itemHeight level1 30 The height of each top-level item, in pixels.
  level2 25 The height of each pop-up level item, in pixels.
itemWidth level1 100 The width of each top-level item, in pixels.
  level2 150 The width of each second-level item, in pixels.
  level3 150 The width of each third-level item, in pixels.
  level4 150 The width of each fourth-level item, in pixels.
  level5 150 The width of each fifth-level item, in pixels.
topLevelIcons enabled "true" Determines whether to draw the icons for the top-level menu items. The top-level icons are built-in and predefined. Possible values: "true", "false".
  size undefined The size of the icon for each top-level menu item, in pixels. The value of this parameter is controlled programmatically and depends on the specified font size and font family. Use this attribute optionally if you want to set your custom value for the size of a top-level icon. Possible values: 5, 7, 9, 12, 14.
popupLevelIcons enabled "true" Determines whether to draw the icons for the menu items of pop-up levels. The pop-up level icons are built-in and predefined. Possible values: "true", "false".
  size undefined The size of the icon for each pop-up level menu item, in pixels. The value of this parameter is controlled programmatically and depends on the specified font size and font family. Use this attribute optionally if you want to set your custom value for the size of a pop-up level icon. Possible values: 5, 7, 9, 12, 14.
tweenDuration rollover 0.2 A number indicating the duration of the tweened animation in seconds. The tweened animation is applied to each top-level item and its nested submenus when fading in and out. Possible values: from 0 to 0.7.
  sliding 0.2 A number indicating the duration of the tweened animation in seconds. The tweened animation is applied to submenu blocks when sliding to the right or to the left. Possible values: from 0 to 0.5.
fadeOut delay 0.4 Amount of time (in seconds) to wait before fading out the rolled-over top-level item and its nested submenus after the mouse pointer is no longer positioned over the menu. Possible values: from 0 to 3.
shiftLeft basic 10 Specifies the distance (in pixels) between the left edge of the top-level item and the left edge of its nested second-level submenu in the state when the third-level submenu is closed.
  slide 40 Specifies the distance (in pixels) between the left edge of the top-level item and the left edge of its nested second-level submenu in the state when the third-level submenu is opened.
glowFilter enabled "true" Determines whether to apply a glow effect to pop-up submenu blocks. Possible values: "true", "false".
itemRollAnimation mode 1 Lets you select which type of animation effect to apply to a pop-up level item when it is rolled over or rolled out. Possible values: 1, 2, 3.
fontFamily name "_sans" The font name for text.
embedFonts enabled "false" A Boolean value that indicates whether the font specified in fontFamily is an embedded font. This parameter must be set to "true" if fontFamily refers to an embedded font. Otherwise, the embedded font is not used. If this parameter is set to true and fontFamily does not refer to an embedded font, no text is displayed. Possible values: "true", "false".
fontSize level1 12 The point size for the font of a top-level item text. Possible values: from 8 to 96.
  level2 11 The point size for the font of a pop-up level item text. Possible values: from 8 to 96.
fontColor level1 "6683AF" The text color of a top-level item.
  level2 "FFFFFF" The text color of a pop-up level item.
fontColorRollover level1 "AFB2B6" The color of text when the pointer rolls over a top-level item.
  level2 "383838" The color of text when the pointer rolls over a pop-up level item.
fontColorSelected level2 "DADEE9" The color of text in the selected pop-up level item.
fontColorDisabled level1 "979797" The text color of a top-level item when it is disabled.
  level2 "B1B4B8" The text color of a pop-up level item when it is disabled.
fontWeight level1 "normal" The font weight for the text of a top-level item. Possible values: "normal", "bold".
  level2 "normal" The font weight for the text of a pop-up level item. Possible values: "normal", "bold".
fontStyle level1 "normal" The font style for the text of a top-level item. Possible values: "normal", "italic".
  level2 "normal" The font style for the text of a pop-up level item. Possible values: "normal", "italic".
textDecoration level1 "none" The text decoration of a top-level item. Possible values: "none", "underline".
textDecorationRollover level1 "none" The text decoration when the pointer rolls over a top-level item. Possible values: "none", "underline".
textAlign level1 "left" The text alignment of a top-level item. Possible values: "left", "center", "right".
textPaddingLevel1 top undefined The spacing between the top edge of a top-level item and the text of its label, in pixels. Use this attribute optionally if you want to set your custom value for this parameter.
  left undefined Specifies the spacing (in pixels) between: (a) the left edge of a top-level item and the text of its label (or the top-level icon, if topLevelIcons is set to "true"), (b) the right edge of a top-level item and the text of its label. Use this attribute optionally if you want to set your custom value for this parameter.
textPaddingLevel2 top undefined The spacing between the top edge of a pop-up level item and the text of its label, in pixels. Use this attribute optionally if you want to set your custom value for this parameter.
  left undefined The spacing between the left edge of a pop-up level item and the text of its label (or the pop-up level icon, if popupLevelIcons is set to "true"), in pixels. Use this attribute optionally if you want to set your custom value for this parameter.
backgroundLevel1 color1 "FFFFFF" The starting (top) color of the gradient fill of a top-level item's background.
  alpha1 0 The starting (top) alpha transparency of the gradient fill of a top-level item's background. Possible values: from 0 to 100.
  color2 "FFFFFF" The ending (bottom) color of the gradient fill of a top-level item's background.
  alpha2 0 The ending (bottom) alpha transparency of the gradient fill of a top-level item's background. Possible values: from 0 to 100.
  rounded "top" Specifies which corners of a top-level item's background to be drawn rounded. Possible values: "all", "left", "right", "top", "bottom", "none".
backgroundLevel1Rollover color "242424" The background color of a rolled-over top-level item.
  alpha 100 The background transparency of a rolled-over top-level item. Possible values: from 0 to 100.
backgroundLevel2 color1 "242424" The starting (top) color of the gradient fill of a pop-up level item's background.
  alpha1 100 The starting (top) alpha transparency of the gradient fill of a pop-up level item's background. Possible values: from 0 to 100.
  color2 "444444" The ending (bottom) color of the gradient fill of a pop-up level item's background.
  alpha2 100 The ending (bottom) alpha transparency of the gradient fill of a pop-up level item's background. Possible values: from 0 to 100.
  rounded "all" Specifies which corners of a pop-up level item's background to be drawn rounded. Possible values: "all", "top", "bottom", "none".
backgroundLevel2Rollover color "C0CCE3" The background color of a rolled-over pop-up level item.
  alpha 100 The background transparency of a rolled-over pop-up level item. Possible values: from 0 to 100.
backgroundLevel2Selected color "747A86" The background color of a selected pop-up level item.
  alpha 100 The background transparency of a selected pop-up level item. Possible values: from 0 to 100.
Note: If you need to use a solid fill (with no gradient), the values of color1 and color2 attributes must be equal, and the values of alpha1 and alpha2 attributes must be equal as well.

2. The following table describes the specific attributes you can add to those <item> nodes of the <items> element that correspond to the top-level menu items. This can be useful if you need to apply separate style declaration for each or certain of top-level item and its submenus.

Note: In this context, "a pop-up level item" means "a second-, third-, fourth- or fifth-level item that belongs to the hierarchy of the current top-level menu item".

Node
name
Attribute
name
Default Description
item widthL1 undefined The width of the current top-level item, in pixels.
  widthL2 undefined The width of the nested second-level submenu, in pixels.
  shiftLeftSlide undefined The distance (in pixels) between the left edge of the current top-level item and the left edge of its nested second-level submenu in the state when the third-level submenu is opened.
  itemL2Opened undefined Lets you set the number of the second-level item which nested submenu you want to be in the open state when the pointer rolls over the current top-level item. This can be useful if you want to attract user's attention to a specific menu item and its content.
  fontColorL1 undefined The text color of the current top-level item.
  fontColorL2 undefined The text color of a pop-up level item.
  fontColorRolloverL1 undefined The color of text when the pointer rolls over the current top-level item.
  fontColorRolloverL2 undefined The color of text when the pointer rolls over a pop-up level item.
  fontColorSelectedL2 undefined The color of text in the selected pop-up level item.
  fontColorDisabledL1 undefined The text color of the current top-level item when it is disabled.
  fontColorDisabledL2 undefined The text color of a pop-up level item when it is disabled.
  bgL1Color1 undefined The starting (top) color of the gradient fill of the top-level item's background.
  bgL1Color2 undefined The ending (bottom) color of the gradient fill of the top-level item's background.
  bgL1Alpha1 undefined The starting (top) alpha transparency of the gradient fill of the top-level item's background. Possible values: from 0 to 100.
  bgL1Alpha2 undefined The ending (bottom) alpha transparency of the gradient fill of the top-level item's background. Possible values: from 0 to 100.
  bgL1Rounded undefined Specifies which corners of the top-level item's background to be drawn rounded. Possible values: "all", "left", "right", "top", "bottom", "none".
  bgL1RolloverColor undefined The background color of the current top-level item when rolled over.
  bgL1RolloverAlpha undefined The background transparency of the current top-level item when rolled over. Possible values: from 0 to 100.
  bgL2Color1 undefined The starting (top) color of the gradient fill of a pop-up level item's background.
  bgL2Color2 undefined The ending (bottom) color of the gradient fill of a pop-up level item's background.
  bgL2Alpha1 undefined The starting (top) alpha transparency of the gradient fill of a pop-up level item's background. Possible values: from 0 to 100.
  bgL2Alpha2 undefined The ending (bottom) alpha transparency of the gradient fill of a pop-up level item's background. Possible values: from 0 to 100.
  bgL2Rounded undefined Specifies which corners of a pop-up level item's background to be drawn rounded. Possible values: "all", "top", "bottom", "none".
  bgL2RolloverColor undefined The background color of a rolled-over pop-up level item.
  bgL2RolloverAlpha undefined The background transparency of a rolled-over pop-up level item. Possible values: from 0 to 100.
  bgL2SelectedColor undefined The background color of a selected pop-up level item.
  bgL2SelectedAlpha undefined The background transparency of a selected pop-up level item. Possible values: from 0 to 100.

3. The <items> element can contain an unlimited number of <item> nodes. Each <item> node represents a menu item object and should have one required attribute label. You can also add 5 optional attributes in the <item> node: action, url, target, enabled, fontColor.

Node
name
Attribute
name
Default Description
item label undefined The text that is displayed to represent a menu item.
  action undefined (Optional) This attribute can be either "getUrl" or the name of your custom Flash function (e.g., "pageInformation"). In the first case, Flash getURL() method is called — it loads a document from the specified URL into the specified window. In the second case, your custom Flash function is called.
  url undefined (Optional) This attribute defines either the URL from which to obtain the document (if action attribute is set to "getUrl") or any parameters to be passed to your function (if action attribute is set to the name of your custom Flash function). You can specify zero or more parameters, separating them by commas.
  target "_self" (Optional) This attribute can be either a parameter ("_self", "_blank", "_parent", "_top" or your custom value) that specifies the window or HTML frame that the document is loaded into (if action attribute is set to "getUrl") or a target movie clip where your function is placed (if action attribute is set to the name of your custom Flash function).
  enabled "true" (Optional) Specifies whether a menu item is enabled or disabled. Possible values: "true", "false".
  fontColor undefined (Optional) The text color of a single menu item (overrides the prior color setting for this particular item).

You can also add one more optional attribute in the <item> node: widthL3/widthL4/widthL5.

Node
name
Attribute
name
Default Description
  widthL3 undefined (Optional) This attribute is set for a second-level item and specifies the width (in pixels) of its third-level submenu.
  widthL4 undefined (Optional) This attribute is set for a third-level item and specifies the width (in pixels) of its fourth-level submenu.
  widthL5 undefined (Optional) This attribute is set for a fourth-level item and specifies the width (in pixels) of its fifth-level submenu.

Note: All colors should be expressed in RRGGBB format.

© E-MERALD. All rights reserved.
© Designed by Fox.net.ua.