Knowledge Base |
Important! All new questions are usually answered within the next business day.
Drop Down (Tree) Menu V3
(views: 4585)
Drop Down Menu V3 and Drop Down Tree Menu V3 are xml flash accordion menus featuring customized states, customized transitions and tweens. Here are all known issues for Drop Down Menu V3 and Drop Down 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.
Load movies on item select
(2008-01-08 - views: 1155)
Q: How can I use the drop-down tree menu to load movies into a content box for a flash website?
A: Each menu item is created using the <item> node from the setup xml file. That node can contain different attributes with different values. You can use listeners to get the selected menu item (either "onPress" or "onRelease") and then read the item's properties.
For example, you could add an extra attribute to each menu item to store the path and file name of the content you want to load:
...
<main>
<item title="File">
<item title="Load First Flash Movie" path="First.swf"/>
<item title="Load Second Flash Movie" path="Second.swf"/>
</item>
...
When a menu item has been pressed, you can detect that event and find out the value of the path attribute:
var listener:Object = new Object();
listener.onRelease = function(evt:Object):Void {
if (evt.item.path != undefined) {
container_mc.loadMovie(evt.item.path);
}
}
myMenu.addEventListener("onRelease", listener);
The attached example file uses the drop down tree menu to load two external flash movies. Off course your code of the onRelease event handler can be changes so you can attach internal movie clips or do whatever you need to do.
Files: DDTM_LoadContent.zip
For example, you could add an extra attribute to each menu item to store the path and file name of the content you want to load:
...
<main>
<item title="File">
<item title="Load First Flash Movie" path="First.swf"/>
<item title="Load Second Flash Movie" path="Second.swf"/>
</item>
...
When a menu item has been pressed, you can detect that event and find out the value of the path attribute:
var listener:Object = new Object();
listener.onRelease = function(evt:Object):Void {
if (evt.item.path != undefined) {
container_mc.loadMovie(evt.item.path);
}
}
myMenu.addEventListener("onRelease", listener);
The attached example file uses the drop down tree menu to load two external flash movies. Off course your code of the onRelease event handler can be changes so you can attach internal movie clips or do whatever you need to do.
Files: DDTM_LoadContent.zip
Login to post your comment
Other questions in this item:
Drop over HTML content Call JavaScript from XML Open menu item pages into target - "_self" Initiate Drop Down Tree Menu V3 through ActionScript Item description from XML Disable-Enable Drop Down (Tree) Menu Navigate through scenes Displaying the submenu horizontally instead of vertical Hand cursor Adding a checkbox to a menu Referencing item's textfield in Drop Down (Tree) Menu V3 Centering the titles on the Drop Down (Tree) Menu V3 Go to different frames by pressing a menu item Changing Design Autoexpand on start Different text formats and anti alias Adding a separating gap between menu items setXML() generates error message Open menu items upwardsMenu |
|
|

