Sie sind auf Seite 1von 8

Accordion Menu V3

ABOUT
The Accordion Menu V3 is a flash component designed to help you load a 2-level menu
structure in an accordion fashion. This is a major upgrade to the previous Accordion Menu,
featuring high level of skinning and customization.
Accordion Menu V3 component is virtually similar to Accordion Tree Menu V3, with the
exception that it does NOT support multi level (3+) accordion menu, only 2-level menus can
be built using this one (Main Menu items and Sub Menu items).
Compatibility
ActionScript: 2.0 only
Flash IDE: Flash 8, Flash CS3
FlashPlayer: FlashPlayer 8, FlashPlayer 9
Whats new in Accordion Menu V3?

built from scratch based on the Jumpeye V3 Standards


skin customization support
full visual customization
tween transition customization
2-level data menu
function called by item click
open urls by item click
true event handling implemented
menu data is loaded using XML
component can be configured using XML

The story of the Accordion Menu V3


We wanted to create the perfect Accordion Menu that would fit all expectations, we wanted
to create an easy way to skin and customize the look and functionality of our initial version
of Accordion Menu.
With more than 2 years of experience in selling the accordions, we have started to
understand what our customers really need, and we know now that the ultimate accordion
menu should easily implement any skin, load xml data for menus, the possibility to change
text style, have customizable tweening and all features that Accordion Menu V3 has.
Accordion Menu V3 is developed especially for web designers and developers who need to
save time and money using the easiest to implement and most skinable accordion menu
ever built, while maximizing the benefits of essential built-in features.

Compatibility Note
Accordion Menu V3 (like all Jumpeye V3 Flash Components) is not compatible with AS3.0.
However, once the AS3.0 version will be released (Jumpeye V3AS3 Release, 2007/Q3
prospect time), all AS2.0 V3 clients will receive FREE upgrades from AS2.0 to AS3.0 for
their separately purchased components.
STYLES
Jumpeyes V3 Components allows skinning with visual elements, Skinning is done via styles
(styles are declared and used in the XML of a menu, but they may link to movieclip and
fonts that need to be found inside a flash file library).
The styles need to be declared inside the <styles> tag, and should be used for items in the
<data> tag of the XML file that feeds the component.
STYLE DECLARATION
All 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
<folderCollapsedIconId>
The value of the node should be the linkage id of the movieclip used for collapsed icon
<folderExpandedIconId>
The value of the node should be the linkage id of the movieclip used for expanded icon
<itemHeight>
The value of the node should be a number that will be used for sizing the height of an item
<spacing>
The value will be used for spacing between icon and text, and where spacing is needed.
<itemNextSpacing>
The value will be used for spacing between items.
<textFormat>
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.
E.g.
<textFormat>
<font>Tahoma</font>
<size>11</size>
<color>0xFF0000</color>
<bold>false</bold>
<italic>false</italic>

<underline>false</underline>
</textFormat>
<states>
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:
<up>
<over>
<down>
<selected>
<disabled>
<expanded_up>
<expanded_over>
<expanded_down>
<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.
State substitution order
The up state has no substitute, all other states may have proximal substitute, or be
substituted by the up state, as following:

ov e r = up
do w n = ov e r = up
sel e c t e d = up
dis a b l e d = up
ex p a n d e d _ u p = up
ex p a n d e d _ o v e r = ov e r = up
ex p a n d e d _ d o w n = ex p a n d e d _ o v e r = do w n = ov e r = up
ex p a n d e d _ s e l e c t e d =s el e c t e d = up

STYLE USAGE
The styles can be used within the <data> child node as follows. Each menu item (folder
item or terminal item) may have its own style, or it can use/inherit its parent childStyle or

it can inherit its parent style, and its parent uses the same method to inherit styles from its
parents.
A theme has the visual items and styles defined for a suite of sub-levels, themes are
packages containing the following:
1. .fla file containing the visual assets of the component
2. .xml file containing the styles and applied to a standard data
3. .as files (rarely, where classes are used to perform a movieclip special effect for
components states)

Insi d e the <data> no d e , ea c h ite m no d e m a y co n t a i n the follo w i n g styl e attri b u t e s :


style - the styl e of on e parti c u l a r ite m . E.g. styl e = s t y l e 1
childStyle - the styl e that ev e r y chil d of this ite m will inh e r i t (in ca s e the y do n't ha v e their
o w n styl e). E.g. chil d S t y l e = a r c t i c
A style can be applied to as many items you want. When an item has no style set, it will
look for a childStyle of its parent following the style substitute order as follows:
item.style > item.parentNode.childStyle > item.parentNode.style >
> item.parentNode.parentNode.childStyle > item.parentNode.parentNode.style
Since the Accordion Menu and the Accordion Tree Menu shares the same themes and styles
for skinning it is very easy to switch between them.
MENU DATA
In 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:
<data>
<main>
<item >
<item />
<item />
<item />
</item>
<item />
<item />
</main>
</data>
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:


GENERAL 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)
enabled - if the menu item is enabled(true) or disabled(false) (optional)
itemHeight - optional style parameter that can override the general style itemHeight
parameter
URL METHOD ATTRIBUTES
url - a url address to be followed when user clicks on the menu (optional)
target - the url target (optional)
FUNCTION ATTRIBUTES
function - the function with brackets and params, its path by dot notation like in eg.:
myFunc(param1,param2) or _root.myMc.someFunction(3) (optional)
USER ATTRIBUTES
any other attributes can be inserted here. You will have access to them from the item itself
with dot notation

PROPERTIES
Property
xmlPath

Type
Component
Inspector
String
Yes

autoSize

Boolean
Yes

closeFolderOnClick

Boolean
Yes

easeType

String
Yes

embedFonts

Boolean
Yes

Description
Optional parameter. Sets the path to a XML file that can configure the
Accordion Menu V3.
Parameters that are set from the <properties> node of the XML
(xmlPath) will override parameters set from script or Component
Inspector.
The <data> node will contain the menu data, entering this node is
essential for the menu to display.
You dont need to use xmlPath param, you can set the XML using the
setXML method.
The <styles> node will contain the styles for menu items, their
movieclip states and how their text is rendered.
Usage:
componentInstance.xmlPath = XMLMenuConfig.xml
If true, the menus width will be calculated automatically. Default: false
Usage:
componentInstance.autoSize = true
If true, when a folder item is expanded and it gets clicked, the item will
collapse, if false, the item will not collapse back until a different folder
item is clicked and expands. Default: false
Usage:
componentInstance.closeFolderOnClick = true
Sets the ease type for the sliding transition tween. Values:[easeOut,
easeIn, easeInOut, none] Default: easeOut
Usage:
componentInstance.easeType =easeOut
If true, embed fonts will be used instead of device fonts. Default: false
Usage:
componentInstance.embedFonts = true

expandMode

String
Yes

indentStepSize

Number
Yes

navigationMode

String
Yes

selectedStateMode

String
Yes

tweening

Boolean
Yes

tweeningDuration

Number
Yes

tweenType

String
Yes

width

Number
No

The expand mode of the menu. To expand one folder item at a time,
choose one, to expand all (more than one) folder items at a time
choose all. Vaues:[one,all] Default: one
Usage:
componentInstance.expandMode = all
The dimension of the indent step size in pixels. This is used to left
indent a child by its parent node. Default: 10
Usage:
componentInstance.indentStepSize = 5
The mode of navigation with the mouse. Values:[press, release,
rollover, none] Default: press
Usage:
componentInstance.navigationMode = rollover
This variable is used to show the selected item (last clicked), with or
without its parents, or not at all. Values:[None, Single, All] Default:
Single
Usage:
componentInstance.selectedStateMode = All
If false, the switching between the items will be done without sliding.
Default: true
Usage:
componentInstance.tweening = false
Sets the duration of the slide tweening in frames. Default: 20
Usage:
componentInstance.tweeningDuration = 10
Sets the tweening type. Values:[Regular, Strong, Bounce, Back, Elastic,
None] Default: Strong
Usage:
componentInstance.tweenType = Back
Used to resize the components width in runtime without affecting the
_xscale of the component. The component will than align and resize (if
needed) the content in order to show the new size.
Usage:
componentInstance.width=200

EVENTS
Event
onLoadXML

onDrawComplete

onRelease

onPress

Description
Event is triggered after the XML is loaded, this happens before loading the content.
Usage:
myEventListener = new Object();
myEventListener.onLoadXML = function(args){
trace("onLoadXML "+ args.target + : + args.success);
}
componentInstance.addEventListener("onLoadXML",myEventListener);
Event is triggered after the content has been visually drawn.
Usage:
myEventListener = new Object();
myEventListener.onDrawComplete = function(args){
}
componentInstance.addEventListener("onDrawComplete",myEventListener);
Event is triggered when onRelease event is invoked on one item.
Usage:
myEventListener = new Object();
myEventListener.onRelease= function(args){
trace(onRelease event on item: + args.item);
}
componentInstance.addEventListener("onRelease",myEventListener);
Event is triggered when onPress event is invoked on one item.
Usage:
myEventListener = new Object();
myEventListener.onPress= function(args){
trace(onPress event on item: + args.item);
}
componentInstance.addEventListener("onPress",myEventListener);

onRollOver

onRollOut

onReleaseOutside

onDragOver

onDragOut

onChange

onMotionFinished

onExpand

onCollapse

Event is triggered when onRollOver event is invoked on one item.


Usage:
myEventListener = new Object();
myEventListener.onRollOver = function(args){
trace(onRollOver event on item: + args.item);
}
componentInstance.addEventListener("onRollOver",myEventListener);
Event is triggered when onRollOut event is invoked on one item.
Usage:
myEventListener = new Object();
myEventListener.onRollOut = function(args){
trace(onRollOut event on item: + args.item);
}
componentInstance.addEventListener("onRollOut",myEventListener);
Event is triggered when onReleaseOutside event is invoked on one item.
Usage:
myEventListener = new Object();
myEventListener.onReleaseOutside = function(args){
trace(onReleaseOutside event on item: +args.item);
}
componentInstance.addEventListener("onReleaseOutside",myEventListener);
Event is triggered when onDragOver event is invoked on one item.
Usage:
myEventListener = new Object();
myEventListener.onDragOver= function(args){
trace(onDragOver event on item: + args.item);
}
componentInstance.addEventListener("onDragOver",myEventListener);
Event is triggered when onDragOut event is invoked on one item.
Usage:
myEventListener = new Object();
myEventListener.onDragOut = function(args){
trace(onDragOut event on item: + args.item);
}
componentInstance.addEventListener("onDragOut",myEventListener);
Event is triggered when onChange event is invoked on one item.
Usage:
myEventListener = new Object();
myEventListener.onChange = function(args){
trace(onChange event on item: + args.item);
}
componentInstance.addEventListener("onChange",myEventListener);
Event is triggered when the tweening is over.
Usage:
myEventListener = new Object();
myEventListener.onMotionFinished = function(args){
}
componentInstance.addEventListener("onMotionFinished",myEventListener);
Event is triggered when a folder item is expanded.
Usage:
myEventListener = new Object();
myEventListener.onExpand = function(args){
}
componentInstance.addEventListener("onExpand",myEventListener);
Event is triggered when a folder item is collapsed.
Usage:
myEventListener = new Object();
myEventListener.onCollapse = function(args){
}
componentInstance.addEventListener("onCollapse",myEventListener);

METHODS
Method
expandAll
collapseAll

expandItem
collapseItem

clickItem
getItem

expandByProperty
collapseByProperty

clickByProperty
getItemByProperty

setXML

getXML
item.expand

item.colapse

item.click

Description
Expands all items of an accordion menu.
Usage:
componentInstance.expandAll()
Collapses all items of an accordion menu.
Usage:
componentInstance.collapseAll()
Expands a folder item identified by its id.
Usage:
componentInstance.expandItem(itemId)
Collapses a folder item identified by its id.
Usage:
componentInstance.collapseItem(itemId)
Generates a click over an item identified by its id.
Usage:
componentInstance.clickItem(itemId)
Returns a reference to an item identified by its id.
Usage:
componentInstance.getItem(itemId):MovieClip
Expands an item identified by a property and its value.
Usage:
componentInstance.expandByProperty(myAttribute, myValue)
Collapses an item identified by a property and its value.
Usage:
componentInstance.collapseByProperty(myAttribute, myValue)
Click an item identified by a property and its value.
Usage:
componentInstance.clickByProperty(myAttribute, myValue)
Returns a reference to an item identified by a property an its value.
Usage:
componentInstance.getItemByProperty(myAttribute, myValue):MovieClip
Sets an XML for the component. You can pass a XML V3 standard to the component
using this method.
Usage:
componentInstance.setXML(myxml:XML)
Returns the XML that fed the component.
Usage:
componentInstance.getXML():XML
This method expands an item but it is applied directly on it, instead of applying it on
the componentInstance.
Usage:
item.expand()
This method collapses an item but it is applied directly on it, instead of applying it on
the componentInstance.
Usage:
item.collapse()
This method generates a click on an item but it is applied directly on it, instead of
applying it on the componentInstance.
Usage:
item.click()

Das könnte Ihnen auch gefallen