Knowledge Base |
Important! All new questions are usually answered within the next business day.
Accordion (Tree) Menu V3
(views: 9702)
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.
clickItem() and expandItem() do not execute actions of menu item
(2008-06-11 - views: 1119)
Q: I keep calling expandItem(itemId) and clickItem(itemId) but they do not have any effect. They only expand or select the target menu item, but they don't execute the actions of the menu item, like calling the function specified in the xml file or triggering the appropriate event. How can this be fixed ?
A: Indeed, the clickItem() and expandItem() methods do only what their name implies and nothing else. If you also would like to receive an event and have the function from the xml file called by the component, then you need a few extra lines of code, besides the one of the two function calls:
accTreeMenu.clickItem(itemId); // or accTreeMenu.expandItem(itemId);
// the next line of code will execute all the actions associated with the navigation mode: press, release or rollover
accTreeMenu.getItemById(itemId).itemAction(accTreeMenu.navigationMode);
var eventType:String;
switch(accTreeMenu.navigationMode) {
case "press" : eventType = "onPress"; break;
case "release" : eventType = "onRelease"; break;
case "rollover" : eventType = "onRollOver"; break;
}
accTreeMenu.dispatchEvent({type:eventType, target:accTreeMenu, item:accTreeMenu.getItemById(itemId)});
accTreeMenu.clickItem(itemId); // or accTreeMenu.expandItem(itemId);
// the next line of code will execute all the actions associated with the navigation mode: press, release or rollover
accTreeMenu.getItemById(itemId).itemAction(accTreeMenu.navigationMode);
var eventType:String;
switch(accTreeMenu.navigationMode) {
case "press" : eventType = "onPress"; break;
case "release" : eventType = "onRelease"; break;
case "rollover" : eventType = "onRollOver"; break;
}
accTreeMenu.dispatchEvent({type:eventType, target:accTreeMenu, item:accTreeMenu.getItemById(itemId)});
User Comments
item.expand()...item = title
The expand() or collapse() methods belong to the items, so you need to get a reference to that item. You can get a reference to an item by using the getItemById() or getItemByProperty() methods. The first method needs to receive the item's id as a String parameter and the second method requires the value of one of the item's properties, like title.
posted by negush on 2008-08-01
The expand() or collapse() methods belong to the items, so you need to get a reference to that item. You can get a reference to an item by using the getItemById() or getItemByProperty() methods. The first method needs to receive the item's id as a String parameter and the second method requires the value of one of the item's properties, like title.
Login to post your comment
Other questions in this item:
Call JavaScript from XML Open menu item pages into target - "_self" Transparent background menu Item description from XML Use hand cursor on menu Can I add a rollover sound? Go to different frames by pressing a menu item Referencing item's textfield in Accordion (Tree) Menu V3 Scene navigation Add different styles for each main items. Keep the Accordion (Tree) Menu V3 vertically aligned Animated items Change Text Color on Rollover Load movies on item select Disable-Enable Accordion (Tree) Menu V3 Adding icons Underline On Rollover how to change fontsize How do I add the AccordionTreeMenuV3 on stage in runtime? Selected item level acc.height not updated? Add a fixed item under the menu How do I add the AccordionTreeMenuV3AS3 from class file to stage Autoexpand on Start Automatic Collapse Get the type of the selected item hotwo: submenus already expanded on activation? Insert a line break into label Children of a menu item Align header text to right Letter kerning Change the position of the menu icons Go To First Child When Select Top Level Menu Item Reference to text fields within menu items Accordion Tree Menu expandAll() Change the position of the folder icons Use hand cursor on menu Open menu upwards Spacing between menu items Step backwards and forwards through menu Rotated text for menu items Accordion menu accurate size Menu Item visibility / disable Letter kerning Go to different frames by pressing a menu item Title on multiple linesMenu |
|
|

how do I specify the item on which i want the method to act?