Hi,
I'm having very tough time in identifying which menu item is clicked so that I can call corresponding movie. I need to call "Movie2.swf" when we click on sub-menu "Find and Call".
on (press) {
// if menu = "Find and Call" call Movie2.swf
}
I really appreciate some guidance.
Thanks
******************************************************
Initialize();
// Initialize Function
function Initialize() {
Busy == False;
SetData();
BuildMenus();
}
// Set Data Function
function SetData() {
// Create arrays to hold menu and item data
Menus = new Array(1);
Menu0Items = new Array(6);
Menu1Items = new Array(10);
// Create an object for each element in the Menus array
Menus[0] = new Object();
Menus[1] = new Object();
// Populate the menu and item data
Menus[0].Name = "How do I ?";
Menus[0].Width = 65;
Menus[0].Items = Menu0Items;
with (Menus[0]) {
Items[0] = "turn phone on"
Items[1] = "make and receive calls"
Items[2] = "store/retrieve numbers";
Items[3] = "send/receive messages";
Items[4] = "start the browser";
Items[5] = "install the battery";
}
Menus[1].Name = "Phone Book";
Menus[1].Width = 85;
Menus[1].Items = Menu1Items;
with (Menus[1]) {
Items[0] = "Find and Call";
Items[1] = "Add Number";
Items[2] = "Find and Edit";
Items[3] = "Voice Labels";
Items[4] = "Groups";
Items[5] = "Email Addresses";
Items[6] = "Calling Cards";
Items[7] = "Options";
Items[8] = "Memory Status";
Items[9] = "Fixed Numbers";
Items[10] = "SOS Numbers";
}
}
// Build Menus Function
function BuildMenus() {
XPosition = 0;
for (Counter = 0; Counter < Menus.Length; Counter ++) {
XPosition = XPosition + Menus[Counter].Width;
_root.AttachMovie("Menu", "Menu" add Counter, 100 + Counter);
eval("Menu" add Counter).Name = Menus[Counter].Name
eval("Menu" add Counter)._x = XPosition;
eval("Menu" add Counter)._y = 10;
}
}
// Show Menu Function
function ShowMenu() {
for (Counter = 0; Counter < Menus[CurrentMenu].Items.Length; Counter ++) {
_root.AttachMovie("Item", "Item" add Counter, 200 + Counter);
eval("Item" add Counter).Name = Menus[CurrentMenu].Items[Counter]
eval("Item" add Counter)._x = eval("Menu" add CurrentMenu)._x
eval("Item" add Counter)._y = (Counter * 20) + 30;
}
eval("Menu" add CurrentMenu).MenuOn = True;
}
// Hide Menu Function
function HideMenu() {
for (Counter = 0; Counter < Menus[CurrentMenu].Items.Length; Counter ++) {
eval("_root.Item" add Counter).removeMovieClip();
}
eval("Menu" add CurrentMenu).MenuOn = False;
_root.Busy = False;
}
// Switch Items Function
function SwitchItems(Item) {
eval(Menus[CurrentMenu].Name).gotoAndStop(Item);
}
I'm having very tough time in identifying which menu item is clicked so that I can call corresponding movie. I need to call "Movie2.swf" when we click on sub-menu "Find and Call".
on (press) {
// if menu = "Find and Call" call Movie2.swf
}
I really appreciate some guidance.
Thanks
******************************************************
Initialize();
// Initialize Function
function Initialize() {
Busy == False;
SetData();
BuildMenus();
}
// Set Data Function
function SetData() {
// Create arrays to hold menu and item data
Menus = new Array(1);
Menu0Items = new Array(6);
Menu1Items = new Array(10);
// Create an object for each element in the Menus array
Menus[0] = new Object();
Menus[1] = new Object();
// Populate the menu and item data
Menus[0].Name = "How do I ?";
Menus[0].Width = 65;
Menus[0].Items = Menu0Items;
with (Menus[0]) {
Items[0] = "turn phone on"
Items[1] = "make and receive calls"
Items[2] = "store/retrieve numbers";
Items[3] = "send/receive messages";
Items[4] = "start the browser";
Items[5] = "install the battery";
}
Menus[1].Name = "Phone Book";
Menus[1].Width = 85;
Menus[1].Items = Menu1Items;
with (Menus[1]) {
Items[0] = "Find and Call";
Items[1] = "Add Number";
Items[2] = "Find and Edit";
Items[3] = "Voice Labels";
Items[4] = "Groups";
Items[5] = "Email Addresses";
Items[6] = "Calling Cards";
Items[7] = "Options";
Items[8] = "Memory Status";
Items[9] = "Fixed Numbers";
Items[10] = "SOS Numbers";
}
}
// Build Menus Function
function BuildMenus() {
XPosition = 0;
for (Counter = 0; Counter < Menus.Length; Counter ++) {
XPosition = XPosition + Menus[Counter].Width;
_root.AttachMovie("Menu", "Menu" add Counter, 100 + Counter);
eval("Menu" add Counter).Name = Menus[Counter].Name
eval("Menu" add Counter)._x = XPosition;
eval("Menu" add Counter)._y = 10;
}
}
// Show Menu Function
function ShowMenu() {
for (Counter = 0; Counter < Menus[CurrentMenu].Items.Length; Counter ++) {
_root.AttachMovie("Item", "Item" add Counter, 200 + Counter);
eval("Item" add Counter).Name = Menus[CurrentMenu].Items[Counter]
eval("Item" add Counter)._x = eval("Menu" add CurrentMenu)._x
eval("Item" add Counter)._y = (Counter * 20) + 30;
}
eval("Menu" add CurrentMenu).MenuOn = True;
}
// Hide Menu Function
function HideMenu() {
for (Counter = 0; Counter < Menus[CurrentMenu].Items.Length; Counter ++) {
eval("_root.Item" add Counter).removeMovieClip();
}
eval("Menu" add CurrentMenu).MenuOn = False;
_root.Busy = False;
}
// Switch Items Function
function SwitchItems(Item) {
eval(Menus[CurrentMenu].Name).gotoAndStop(Item);
}