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!

Problem with menus

Status
Not open for further replies.

DKL01

Programmer
Sep 14, 2000
233
US
Hi,

What's wrong with this code ? I'm getting sub menus "A", "B", "C",....... under CallInfo as well as under Settings.
Under CallInfo it should display "Missed Calls", "Call List",.......


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(4);
Menu0Items = new Array(3);
Menu1Items = new Array(9);
Menu2Items = new Array(6);
Menu3Items = new Array(5);
Menu4Items = new Array(9);

// Create an object for each element in the Menus array
Menus[0] = new Object();
Menus[1] = new Object();
Menus[2] = new Object();
Menus[3] = new Object();
Menus[4] = 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] = "make and receive calls"
Items[1] = "store/retrieve numbers";
Items[2] = "send/receive messages";
Items[3] = "browser functions";
}

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/ SOS Numbers";
}

Menus[2].Name = "Messages";
Menus[2].Width = 100;
Menus[2].Items = Menu2Items;
with (Menus[2]) {
Items[0] = "Call Voicemail";
Items[1] = "Inbox";
Items[2] = "Send New";
Items[3] = "Unsent";
Items[4] = "Templates";
Items[5] = "Sent Items";
Items[6] = "Options";
}

Menus[3].Name = "Call Info";
Menus[3].Width = 85;
Menus[3].Items = Menu3Items;
with (Menus[3]) {
Items[0] = "Missed Calls";
Items[1] = "Call List";
Items[2] = "Call Costs";
Items[3] = "Call Timers";
Items[4] = "Next Call";
Items[5] = "Options";
}

Menus[4].Name = "Settings";
Menus[4].Width = 85;
Menus[4].Items = Menu3Items;
with (Menus[4]) {
Items[0] = "A";
Items[1] = "B";
Items[2] = "C";
Items[3] = "D";
Items[4] = "E";
Items[5] = "F";
Items[6] = "G";
Items[7] = "H";
Items[8] = "I";
Items[9] = "J";
}

}


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;
}
}
 
I noticed the problem

Instead of Menus[4].Items = Menu3Items;
it should be Menus[4].Items = Menu4Items;

Thanks
 
Hello All:

I'm wondering how to call a movie clip (using action script ) when we click on sub-menu.

Thanks
 
Thanks for you response..

I tried but looks like I'm doing something wrong. I'm getting error :

Scene=Scene 1, Layer=ActionScript, Frame=1: Line 54: Mouse events are permitted only for button instances
on (press) {

Scene=Scene 1, Layer=ActionScript, Frame=1: Line 55: ';' expected
Tell Target(&quot;/Movie2&quot;);

with following code:

Menus[1].Name = &quot;Phone Book&quot;;
Menus[1].Width = 85;
Menus[1].Items = Menu1Items;
with (Menus[1]) {
Items[0] = &quot;Find and Call&quot;;
with (Items[0]) {
on (press) {
Tell Target(&quot;/Movie2&quot;);
}
}
Items[1] = &quot;Add Number&quot;;
Items[2] = &quot;Find and Edit&quot;;
Items[3] = &quot;Voice Labels&quot;;
Items[4] = &quot;Groups&quot;;
Items[5] = &quot;Email Addresses&quot;;
Items[6] = &quot;Calling Cards&quot;;
Items[7] = &quot;Options&quot;;
Items[8] = &quot;Memory Status&quot;;
Items[9] = &quot;Fixed/ SOS Numbers&quot;;
}
 
May be the information I provided is to not too clear to understand the problem. If anybody interersted I can send the FLA file through e-mail.

Thanks

Dilip
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top