GhostWire CollapsibleMenu - Usage
Using the CollapsibleMenu component
First, drag an instance of the CollapsibleMenu from the Components Panel to the Stage. Give this instance a name, example "myMenu". Position the component where you want it.
For the best effects, we recommend that you set your application to a non-scaling mode by entering the following actionscript in the first frame of your application:
Stage.scaleMode = "noScale";
Stage.align = "TL";
---
How do I set the size of the component?
During authoring time, you can set the size by using the Transform tool. The width you set for the component during authoring time determines its minimum width during runtime. Note that the component will automatically resize itself if necessary to accomodate the width of the menu items during runtime. The height depends on the number of menu items (and the rowHeight property) and cannot be changed directly. During runtime, you can use the setSize(width) method to adjust the width. Example:
myMenu.setSize(640);
---
What are the built-in handlers when a menu item has been selected?
Under the properties panel of the component, you can set the Action - either 'Event', 'GetURL', 'GotoAndPlay' or 'GotoAndStop'. Event is selected by default.
---
How do I make movie/page navigate to a URL when a menu item is selected?
If you set Action to 'GetURL', then the 'data' associated with each menu item is assumed to be a URL and the getURL method will be called passing the 'data' as the URL.
---
How do I make the movie navigate to another frame when a menu item is selected?
If you set Action to 'GotoAndPlay' or 'GotoAndStop', then the 'data' associated with each menu item is assumed to be a frame number/label and the gotoAndPlay or gotoAndStop methos will be called passing the 'data' as the frame/label.
---
How do I create custom reactions when a menu item has been selected?
Please set Action to 'Event'. The component has an event handler called 'onSelect'. You use this to create custom reactions to user interactions with the component. Example:
myMenu.onSelect = function(data)
{
// data is the value associated with the menu item just selected
// handle data here
}
---
How do I specify 'target' for getURL?
If you have set the 'action' property of the component to 'GetURL' and you wish to specify a target for the getURL action, the 'data' property of the menu item must be an object containing two properties - 'target' and 'url' (both must be defined). If you are using setDataProvider method to populate the component during runtime, here is an example:
var data = [];
data[0] = {label:"@parent0",data:{target:"_mainframe",url:"parent0.html"}}
data[1] = {label:"child1",data:{target:"_childframe",url:"child1.html"}}
data[2] = {label:"child2",data:{target:"_childframe",url:"child2.html"}}
data[3] = {label:"@parent1",data:{target:"_mainframe",url:"parent1.html"}}
data[4] = {label:"child3",data:{target:"_childframe",url:"child3.html"}}
data[5] = {label:"child4",data:{target:"_childframe",url:"child4.html"}}
If you are using XML, you need to specify 'target' and 'url' attributes in lieu of the 'data' attribute for the menu item in your XML file.
---
How do I use XML with the component?
The component has a 'xmlPath' parameter. If you specify this parameter (a string specifying the path to your XML file), the component will attempt to load this XML file, parse it and populate itself with the menu items defined in the XML file. The structure of the XML file should follow (remember to view source before copying, or use "save target as" in context menu to save the file):
http://ghostwire.com/swf/collapsiblemenu_en.xml
Each menu item should be defined with at least the 'label' and 'data' properties (attributes). You may also define an 'icon' property. Additionally, if you are setting 'action' property of the component to 'GetURL', you may also wish to define 'target' and 'url' properties in lieu of the 'data' property.
You may also use the 'loadXML' method to load an external XML file during runtime.
---
How do I use the setDataProvider method to populate the component?
An example would be:
CODE |
var data = [];
data[0] = {label:"@parent0",data:"parent0.html"}
data[1] = {label:"@parent1",data:"parent1.html"}
data[2] = {label:"child1",data:"parent1/child1.html"}
data[3] = {label:"child2",data:"parent1/child2.html"}
data[4] = {label:"child3",data:"parent1/child3.html"}
data[5] = {label:"@parent2",data:"parent2.html"}
data[6] = {label:"child1",data:"parent2/child1.html"}
data[7] = {label:"child2",data:"parent2/child2.html"}
data[8] = {label:"child3",data:"parent2/child3.html"}
data[9] = {label:"@parent3",data:"parent3.html"}
data[10] = {label:"child1",data:"parent3/child1.html"}
data[11] = {label:"child2",data:"parent3/child2.html"}
data[12] = {label:"child3",data:"parent3/child3.html"}
myMenu.setDataProvider(data);
|
Flash Components
Button
:: CheckBox
:: CollapsibleMenu
:: CollapsiblePane :: ColorPicker :: ComboBox
:: ContextMenu
:: DialogBox
:: InputField
:: ListBox :: Loader :: Menu
:: SlideMenu
:: NumericBox
:: Panel :: ProgressBar :: RadioButton
:: ScrollBar
:: ScrollPane
:: SlidePane
:: Slider
:: TabView
:: TextArea
:: TreeView
:: Window
See also
Documentation :: FAQs :: Testimonials
|