Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DIFFICULT *Menubar MX2004 Component*

Posted on 2004-10-21
10
Medium Priority
?
142 Views
Last Modified: 2010-04-03
0
Comment
Question by:gmailrules
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 6

Expert Comment

by:nishasrilankan
ID: 12377624
here is the working downloadable example.
http://philflash.inway.fr/menubar/menubar.html
0
 
LVL 1

Author Comment

by:gmailrules
ID: 12378103
no, every one has a submenu.  the problem is getting an event listener to work with the menu items rather than the menu submenu items
0
 
LVL 6

Expert Comment

by:nishasrilankan
ID: 12378242
With Menu component you cannot attach Event Handlers...that can be only achieved with MenuBarItem Class....MenuBarItem class has six event handlers..onPress, onRelease, onRollOver, onRollOut, onDragOver and onDragOut...
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:gmailrules
ID: 12378307
i think the menu component has a focusin even handler and menubaritem has a change handler
0
 
LVL 1

Author Comment

by:gmailrules
ID: 12378315
how would i modify the class to add the change event handler to the menu buttons then?
0
 
LVL 6

Expert Comment

by:nishasrilankan
ID: 12378384
Sorry...Menu has following event handlers..
Event summary for the Menu class

Menu.change
 Broadcast when a user causes a change in a menu.
 
Menu.menuHide
 Broadcast when a menu closes.
 
Menu.menuShow
 Broadcast when a menu opens.
 
Menu.rollOut
 Broadcast when the pointer rolls off an item.
 
Menu.rollOver
 Broadcast when the pointer rolls over an item.
 


///Actually Change event handler is already there
0
 
LVL 1

Author Comment

by:gmailrules
ID: 12378395
yeah but i cant get it to work, and from what i can tell from searches other people are having the prob as well
0
 
LVL 6

Expert Comment

by:nishasrilankan
ID: 12378541
Sorry...I dont think that can be implemented..
0
 
LVL 27

Accepted Solution

by:
negatyve earned 2000 total points
ID: 12409684
*aware: hack* :)

var listener:Object = new Object();
listener.change = function(evt:Object):Void
{
     trace(evt.menuItem.parentNode.attributes.label);
};

var menu:mx.controls.Menu = menu_mc.addMenu("asia");
menu.__activator.oldOnPress = menu.__activator.onPress;
menu.__activator.onPress = function()
{
      this.oldOnPress();
      trace("MENU 1");
};
menu.addEventListener("change", listener);
menu.addMenuItem("india");
menu.addMenuItem("china");
menu.addMenuItem("pakistan");

var menu:mx.controls.Menu = menu_mc.addMenu("europe");
menu.__activator.oldOnPress = menu.__activator.onPress;
menu.__activator.onPress = function()
{
      this.oldOnPress();
      trace("MENU 2");
};
menu.addEventListener("change", listener);
menu.addMenuItem("denmark");
menu.addMenuItem("britain");
menu.addMenuItem("spain");
0
 
LVL 1

Author Comment

by:gmailrules
ID: 12576395
Sorry I took so long to get back to this question.  Thanks a lot for the anwser :D
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question