Menu 01 Javascript Interaction
Author: Digicrafts Last Update: 26/08/2008
Javascript Interaction with Menu 01
1. In the "Other" interface, tick the "Enable Item Event".
2. In the html file, insert the event javascript. Menu 01 includes 4 standard event listeners for implementation. Only define the event function you need. Menu 01 will bypass the event that user do not define.
<script type="text/javascript">
//Suppose the flash object id is menu01
var menu01 = new DWControl('menu01');
menu01.onItemClick = function(id, selectedItem) {
//Implement the function when item click
alert ("Click on: " + id + " " + selectedItem.id + " " + selectedItem.title);
}
menu01.onItemSelect = function(id, selectedItem) {
//Implement the function when item select
alert ("Select: " + id + " " + selectedItem.id + " " + selectedItem.title);
}
menu01.onItemRollOver = function(id, selectedItem) {
//Implement the function when mouse over
alert ("Roll Over: " + id + " " + selectedItem.id + " " + selectedItem.title);
}
menu01.onItemRollOut = function(id, selectedItem) {
//Implement the function when mouse out
alert ("Roll Out: " + id + " " + selectedItem.id + " " + selectedItem.title);
}
</script>



<script type="text/javascript">
menu01.onItemClick = function(id, selectedItem)
alert (selectedItem.url);
}
</script>