Tags: FishEye Menu

FishEyeMenu Class Update… v1.1

Thanks to a comment posted by doggy, I’ve updated the FishEyeMenu class to listen for MouseDown events and keep track of selected items.   New Functions: public function get selected():* public function get lastSelected():*  public function set selected( clickedItemEvent:MouseEvent ):void   New Event Type FishEyeMenu.SELECTED_CHANGED – Triggered upon a change in selected menu item Once you’ve pushed an item into the FishEyeMenu object, it keeps track of it’s own MouseDown events on the items in it’s array.  When a user clicks on a menu item, it sets the _lastSelected property to whatever Was selected, and sets the _currentSelected property to whatever menu item was clicked.   You can now add an event listener for SELECTED_CHANGED which will dispatch upon MouseDown on a menu item. Please note, the getters for selected and lastSelected are going to return the actual Object that you pushed to the menu.  So it will return a reference to the actual TextField or MovieClip or Sprite or whatever you’re using in the menu.  If you check the Example FLA, you’ll see this code as an example // in the main function fishEyeMenu.addEventListener( FishEyeMenu.SELECTED_CHANGED , changedHandler );   //later in the code: /** * Simple test of usage, fishEyeMenu.selected returns the object selected * so it's just like calling the actual object that was clicked last and * you can set whatever properties that object has. * If this were a MovieClip, you could use fishEyeMenu.selected.gotoAndStop() ***/ private function changedHandler( e:* ) { trace( "Selected Item Changed to : " + fishEyeMenu.selected.name ); trace( "Selected Item Changed to : " + fishEyeMenu.lastSelected.name ); fishEyeMenu.selected.x +=20; } In the simple example, calling fishEyeMenu.selected.x += 20; just moves the object you clicked over 20 pixels to the right (+20). But you could also use fishEyeMenu.selected.gotoAndStop( “Selected” ); if you had […]

Read More…
FacebookTwitterGoogle+Share

AS3 FishEye Menu Downloadable Class + TweenLite Example

I made the mistake of looking over some of my past blogs.  My god the code I unleashed from this FishEye Menu Example post, how sloppy was that??!  Ah.. late nite coding.. gotta love it.   At the end of Jan, code hero Jack @ GreenSock released a hot new version of his TweenMax/Lite Tweening masterpiece.  Employing a new ‘plugin’ system for some of the options, it has made things smaller, faster, and more efficient than before.  It’s pretty slick and you should check it out. So, in honor of his update (more to keep up with said update) I created a FishEye Menu Reusable Class that can be downloaded here @ Google Code.  Keep in mind this is rather in its rough draft “beta” stage… as in, if it breaks your code and formats your harddrive and causes a separation with your significant other… well… thats “beta testing” for you!  It’s pretty solid from the testing I’ve done, but I’m interested in getting feedback and definitely in hearing of any errors you might receive.   Thats the most exciting thing about releasing code for me; finding out all the ways someone is trying to use my code that I didn’t pre-plan for.  So with that in mind, download the new FishEye Menu class, play around with it, and let me know how it works for you.  There is a second file there with the FLA and a Main class file that calls the FishEyeMenu class.   I’ve also got another AS3 pair of Classes that I’ll be posting soon… a Waypoint & WaypointList Class for use in AS3 game development.  Should be interesting.   Check out the Wiki for info on How to use the FishEyeMenu Class.

Read More…