Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menus NEED HELP

Status
Not open for further replies.

DKL01

Programmer
Sep 14, 2000
233
US
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(&quot;Menu&quot;, &quot;Menu&quot; add Counter, 100 + Counter);
eval(&quot;Menu&quot; add Counter).Name = Menus[Counter].Name
eval(&quot;Menu&quot; add Counter)._x = XPosition;
eval(&quot;Menu&quot; add Counter)._y = 10;
}
}

// Show Menu Function
function ShowMenu() {
for (Counter = 0; Counter < Menus[CurrentMenu].Items.Length; Counter ++) {
_root.AttachMovie(&quot;Item&quot;, &quot;Item&quot; add Counter, 200 + Counter);
eval(&quot;Item&quot; add Counter).Name = Menus[CurrentMenu].Items[Counter]
eval(&quot;Item&quot; add Counter)._x = eval(&quot;Menu&quot; add CurrentMenu)._x
eval(&quot;Item&quot; add Counter)._y = (Counter * 20) + 30;
}
eval(&quot;Menu&quot; add CurrentMenu).MenuOn = True;
}

// Hide Menu Function
function HideMenu() {
for (Counter = 0; Counter < Menus[CurrentMenu].Items.Length; Counter ++) {
eval(&quot;_root.Item&quot; add Counter).removeMovieClip();
}
eval(&quot;Menu&quot; add CurrentMenu).MenuOn = False;
_root.Busy = False;
}

// Switch Items Function
function SwitchItems(Item) {
eval(Menus[CurrentMenu].Name).gotoAndStop(Item);
}
 
I found it.

on (release) {

if (name == &quot;Groups&quot;) {
loadMovieNum(&quot;Movie2.swf&quot;, 0);
}

if (name == &quot;Find and Call&quot;) {
loadMovieNum(&quot;Movie3.swf&quot;, 0);
}
}

Thanks

Good Night

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top