Knowledge Base |
Accordion (Tree) Menu V3
(views: 20449)
Accordion Menu V3 and Accordion Tree Menu V3 are xml flash accordion menus featuring customized states, customized transitions and tweens. Here are all known issues for Accordion Menu V3 and Accordion Tree Menu V3, they should be similar, since basically it is the same component. If you have any questions that you think we should discuss here please let us know.
Selected item level
(2007-08-15 - views: 4680)
Q: How can I find out on which level is found the selected item of an Accordion Tree Menu component ?
A: Just like in the case of the Accordion Menu component, there are two ways to get the level on which the selected menu item is. Both ways are presented in the demo file and are well commented.
Files: ItemType2.zip
Files: ItemType2.zip
User Comments
AS3 version
To find out on which level is found the selected item, you must use this code, which is actually similar to that used in the AS2 example except "addEventListener".
import com.jumpeye.Events.AccordionMenuEvents;
accTreeMenu.addEventListener(AccordionMenuEvents.ITEM_RELEASE, releaseHdl);
function releaseHdl (evt: AccordionMenuEvents):void{
var itemIndex:String = String(evt.item.treeId);
trace (evt.item.treeId)
var idArray:Array = itemIndex.split(".");
var noOfStrings:Number = idArray.length;
trace(idArray.length);
switch(noOfStrings) {
case 1: descr.text = "First level item - " + itemIndex; break;
case 2: descr.text = "Second item - " + itemIndex; break;
case 3: descr.text = "Third item - " + itemIndex; break;
trace(noOfStrings)
}
}
posted by florodebat on 2009-01-27
HelloTo find out on which level is found the selected item, you must use this code, which is actually similar to that used in the AS2 example except "addEventListener".
import com.jumpeye.Events.AccordionMenuEvents;
accTreeMenu.addEventListener(AccordionMenuEvents.ITEM_RELEASE, releaseHdl);
function releaseHdl (evt: AccordionMenuEvents):void{
var itemIndex:String = String(evt.item.treeId);
trace (evt.item.treeId)
var idArray:Array = itemIndex.split(".");
var noOfStrings:Number = idArray.length;
trace(idArray.length);
switch(noOfStrings) {
case 1: descr.text = "First level item - " + itemIndex; break;
case 2: descr.text = "Second item - " + itemIndex; break;
case 3: descr.text = "Third item - " + itemIndex; break;
trace(noOfStrings)
}
}
Login to post your comment




I'm trying to get the id of the items in my AS3 version of the menu, so i can call and item.click on a particular menu. But when i trace out the item, it just says [object JAccordianTreeMenuChild]. I've tried using toString() on this, but give me the same thing. how can I obtain the item Id?
thank you.