If you build just about any Flash application you will need a menu that will manage button states and let you know when something has been clicked. This class will do that and can be implemented in projects big and small. Below is a very basic example on how it can be used, on the Mall World page it is implemented six times. Can you guess where?
A very basic implementation
[embed swf="/flash/examples/MenuImplementationExample.swf" width="640" height="140" version="9"][/embed]
Creating a Menu Object can be as simple as this
var menu = new Menu();
menu.addItem({clip: buttonOne, id: 1});
menu.addItem({clip: buttonTwo, id: 2});
menu.addEventListener(MenuEvent.NAVIGATE, this.menuNavigateHandler);
This code is released under the MIT License with just one request. If you improve it in some way that could benefit other users leave a comment.




No Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URI
Leave a comment