Methods

XMLMenu class

org.thesourcecode.utils.XMLMenu

extends
MovieClip

 

Overview

Author

Hasan Otuome [hasan.otuome.com]

Version

1.1

Usage

import org.thesourcecode.utils.XMLMenu;
var myMenu:XMLMenu =  new XMLMenu()

Description

Simplifies creating an XML menu in Flash.

Just provide the location of the XML file, the name of a "container" MovieClip, a number for the amount of space between each clip, and a Boolean value (true/false) for whether you want the menu items to tile horizontally or vertically

NOTE: This class expects an XML file with nodes that use attributes. For example

 button id="1" lbl="yourButtonText" hdr="sectionHeaderText" loc="URL or MovieClip" 


Methods

 

buildMenu

Usage

myMenu.buildMenu(file,target,space,vertical)

Description

Parses the XML source indicated by file and uses that data to generate a menu in the target MovieClip

Parameters

file
(String) URL of the XML file
target
(MovieClip) instance name of the "menu holder" clip
space
(Number) indicates how much space between each movie clip. Suggestion: Use either the width or height of your "menu item" MovieClip + 1
vertical
(Boolean) a value of true will tile the "menu items" vertically. Leaving this parameter out will tile them horizontally

Returns

Nothing.