
Please update your flash player
Download Group94 style scrolling menu
I built this circular version of the group94 style scrolling menu for a flash website awards showcase I was asked to work on. The original design was based around circles, but we ended up redesigning as parts of the interface (not this menu!) were too processor intensive.
Ok, so part two of my tribute to Group 94’s menu system! This is again inspired by the Group 94 (at least they are most famous for it) shuffle menu in Flash, which pushes items off the top and bottom as the menu shuffles into place.
This version is circular though, and each menu item rotates around a pivot. Initiating the prototype with particular variables will define the spacing between items, the radius of the Group 94 circular menu and the amount of items visible at one time.
Please note, this is in no way a rip of the Group 94 menu. In fact, I haven’t even seen a circular version which is why I made it. I have no idea how Group 94’s actionscript looks, or how they would have approached this style of menu. I do know however, that they have produced many innovative navigation systems, and so this is a simple tribute to their talent and innovation.
As with the regular group 94 scrolling menu, you will need Fuse installed, though all it does is handle tweening so you could use tweener or the inbuilt Flash tweening functions. I just prefer Fuse!
How it is done.
First import Fuse for tweening, then setup the array we will use for the menu:
import com.mosesSupposes.fuse.*; ZigoEngine.simpleSetup (Shortcuts,PennerEasing); var planets:Array = new Array (); planets.push ("Mercury"); planets.push ("Venus"); planets.push ("Earth"); planets.push ("Mars"); planets.push ("Jupiter"); planets.push ("Saturn"); planets.push ("Uranus"); planets.push ("Neptune"); planets.push ("Pluto");
Then some very basic functionality for each menu button. I have ommited rollOvers for the demo…
MovieClip.prototype.circNavBtn = function (id:Number, par:MovieClip, name:String) { this.pos = this.id = id; this.par = par; this.btn.txt.text = name.toUpperCase (); this._rotation = 90; this._alpha = 0; this.onPress = function () { this.par.circNavRot (this.pos); this.activeBtn (); }; };
Then two small prototypes to handle the activation and de-activation of the buttons when the scroll function is called:
MovieClip.prototype.activeBtn = function () { activeNavBtn.inactiveBtn (); activeNavBtn = this; this.btn.scaleTo (200,0.5); this.enabled = false; }; MovieClip.prototype.inactiveBtn = function () { this.btn.scaleTo (100,0.5); };
Then the main shuffle or rotation function, which designates tweens to all visible movieClips and hides those outside of the visible items range.
MovieClip.prototype.circNavRot = function (num:Number) { var diff:Number = num; for (var i:Number = 0; i < this.btns.length; i++) { var btn:MovieClip = this["navBtn" + i]; btn.pos -= diff; if (Math.abs (btn.pos) < this.visItems) { var offset:Number; btn.pos != 0 ? (offset = btn.pos > 0 ? 15 : -15) : offset = 0; var rot:Number = offset + (this.spacing * btn.pos); var alph:Number = 100 - ((100 / this.visItems) * Math.abs (btn.pos)); var scl:Number = 100 - (5 * Math.abs (btn.pos)); btn.rotateTo (rot,0.5,"easeOutExpo"); btn.alphaTo (alph,0.5); btn.btn.scaleTo (scl,0.5); } else { btn.stopTween ("_alpha"); btn.stopTween ("_rotation"); btn._rotation = btn.pos > 0 ? 90 : -90; btn._alpha = 0; } btn.enabled = Math.abs (btn.pos) < this.visItems; } this["navBtn" + num].activeBtn (); };
Now we setup the circular scrolling menu on a movieClip:
MovieClip.prototype.circNav = function (array:Array, radius:Number, spacing:Number, visItems:Number) { this.btns = new Array (); this.spacing = spacing; this.visItems = visItems; for (var i:Number = 0; i < array.length; i++) { var navBtn:MovieClip = this.createEmptyMovieClip ("navBtn" + i, i); var btnTxt:MovieClip = navBtn.attachMovie ("btn", "btn", 0); btnTxt._x = radius; navBtn.circNavBtn (i,this,array[i]); this.btns.push (navBtn); } this.circNavRot (0); };
Here we dynamically create a movieClip, position it, then call our prototype to create the lovely Group94 style menu…
var testMenu:MovieClip = this.createEmptyMovieClip ("nav", 0); testMenu._x = 20; testMenu._y = 112; testMenu.circNav (planets, 60, 15, 4);
And finally we add the ability to use the mouse wheel to scroll the menu. otherwise we just click the menu items:
var mouseListener:Object = new Object (); mouseListener.onMouseWheel = function (delta) { var navIndex:Number = activeNavBtn.id; if (delta < 0 && activeNavBtn.id < planets.length - 1) { testMenu.circNavRot (1); testMenu["navBtn" + (navIndex + 1)].activeBtn (); } else if (delta > 0 && activeNavBtn.id > 0) { testMenu.circNavRot (-1); testMenu["navBtn" + (navIndex - 1)].activeBtn (); } }; Mouse.addListener (mouseListener);
I hope this is useful to someone! If you find a home for it, please let me know.
43 Responses to G94 Circular Menu
goliatone
Aug 7th 2007
4:01 pm
hi Justin,
really cool stuff! Im happy that you actually did answer my post. thumbs up!
regards,
goliatone
cube
Oct 3rd 2007
8:45 am
Great piece of script and a beautiful page as well! Wordpress? Any special theme?
BTW: There must be a small bug in the script as the fading buttons are not active constantly. Will try to figure it out and tell you if I find a solution.
BTW2: Been in your library… I would recommend “The pillars of the earth” by Ken Follett if you got some time left. Good book… no, great book! ;)
BTW3: You got one more rss-reader.
cheers,
cube
John
Nov 1st 2007
6:36 am
Hi there,
Was just wondering what version of Flash your using. I have Flash 8 and can’t open the download.
Cheers,
John.
Jeremy
Dec 12th 2007
7:38 am
Hello,
very nice menu! Just wondering if it is possible to replace the text with images?
Cheers
Jeremy
Sensbachtal
Mar 17th 2008
2:24 am
Just wanted to say Hello to everyone.
Much to read and learn here, I’m sure I will enjoy !
ActionScripted Circular Menu: Ahad Bokhari
May 12th 2008
1:58 pm
[...] visit HERE for the code by [...]
??
Jun 10th 2008
9:03 pm
I was just wondering how i would add url’s tothe buttons
thanks
Soulwire
Jun 10th 2008
9:56 pm
Hi ?? (mysterious!)
If you want the buttons to open URLs, you can simply modify the prototype for the buttons to accept a url parameter, and then call getURL onPress, something like:
Then use an array of links which corrospond to the array of names:
…and finally, pass the url parameter to the buttons when you create them (inside the circNav prototype)
Good luck :)
??
Jun 11th 2008
4:07 pm
Thanks for the quick reply
I was wondering how I would get the url’s to open on teh current page instead of opening on another (blank page)
thanks again
Soulwire
Jun 11th 2008
7:50 pm
Sure, all you have to do is change the target to ‘_self’:
Chris
Aug 8th 2008
1:50 pm
Hello, you have some GREAT AS3 tutorials!
I especially like this Menu. I am considering trying to change it over to AS3, but I was wondering why you haven’t done that. Is there a reason I should not even try?
Soulwire
Aug 8th 2008
2:18 pm
Hi Chris,
No, no reason, other than not having the time. It will be quite easy to convert to AS3, at least once you’ve understood the new event model.
This script, and its G94 counterparts are quite popular, so I’m writing a more complete AS3 class, which can be horizontal or vertical and accept images, load from XML etc. It will be a while though as I’m really busy at the moment. I’ll look into added ‘Circular’ as an option to the layout feature in the new classes.
In the meantime, let me know how you get on and if you find a use for it, in AS2 or 3.
Cheers
joseph
Sep 3rd 2008
1:30 pm
First off your tutorials are put together superbly and much appreciated. I would like to know how i would add a new movieclip to the buttons. i.e. on press another movieclip would show. To give you a bit more insight, I am using the circ menu to show regions and I would like it to show on button press the group 94 as3 style menu you have posted with locations from that region. Hope I have explained correctly.
With hope, thanks for now. And again any help is much appreciated
nunzio
Oct 1st 2008
1:25 pm
Hello, very very .. cool menu, i want to ask you something :
How can i make the same menu but in the other side rotation?
I need to have a menu with the half circle on the left side.
With hope, thanks for now.
bye nunzio
Leopat Magnus
Oct 10th 2008
6:54 pm
Hello, great script.
I want to know can i make the button’s works, like gotoAndStop(someframe);
Thanks in advance.
Soulwire
Oct 10th 2008
8:35 pm
Hey Leo,
You can use the activeBtn and inactiveBtn prototypes. For example:
aurelplouf
Nov 6th 2008
9:09 am
Hello,
I love your work, and I would really want to have a version of this circular menu in Actionscript 3.
I have been trying to dissect the code and re-constitute something that would look like Actionscript3, but its quite tough for my level of knowledge.
If you have an AS3 version of this menu bar, I would be very thankful ;)
Aurel
AS3 Circular Group94 style scrolling menu class with source code and demo
Nov 6th 2008
4:29 pm
[...] Comments G94 Circular Menu 25% similar Group94 Inspired Circular scrolling menu [...]
Soulwire
Nov 6th 2008
4:36 pm
Hi Aurelplouf
AS3 version is now available!
It’s not a direct conversion, but rather a new version with a ton of cool new features. Hope you like it…
http://blog.soulwire.co.uk/flash/actionscript-3/as3-g94-circular-menu/
bigJo
Nov 28th 2008
7:04 pm
Hi
Great job!!!
Someone can help me ? if possible change you array into a Xml file
Thanks guys
bigJo
Dec 1st 2008
4:59 pm
nobody can help?
Soulwire
Dec 1st 2008
6:06 pm
Hi Big Jo.
why don’t you try this:
Make an XML file:
Then parse the XML file and create the circular menu using the XML nodes:
That should do it :)
bigJo
Dec 1st 2008
7:23 pm
Hi Soulwire Thanks for you answer but steel dont working i dont no why ?
Soulwire
Dec 1st 2008
7:53 pm
Try copying the block of code that parses the XML and the call to load it (”planetsXML.load(’planets.xml’);“) and pasting it at the bottom of your code, after the code for the prototypes. That should solve it because it will register the prototypes before you attempt to use them (in the line “testMenu.circNav (planets,60,15,4);” )
bigJo
Dec 1st 2008
8:05 pm
I have tried but nothing happend , i trace the xml “trace(planetsList);” that ok! flash call the xml but the node dont attach ” testMenu”
Thanks Soulwire for your help
Soulwire
Dec 1st 2008
9:13 pm
Haha, sorry! I’ve just realised I wasnt paying attention to something. It’s been a while since I wrote AS2 and I didn’t look closely at what I wrote. Saying var testMenu:MovieClip = this.createEmptyMovieClip(”nav”, 0); within the scope of the XML onload function means that “this” is referring to the XML and not the root. So try instead:
bigJo
Dec 1st 2008
9:30 pm
YEAAHH!!! Great thank a lot Soulwire cool cool !!!!
TONY
Dec 11th 2008
2:33 am
How would i add load external swf with buttons?
john
Feb 11th 2009
9:05 pm
Hey this is really great .. how do i change this with Tweenlite instead of fuse ..
One other thing is i dont want it to rotate . i want the rotation to remain 0 but along the cirle something like this http://rapidshare.com/files/196916893/Untitled-1.png.html
Soulwire
Feb 11th 2009
9:20 pm
Hi John,
Have you seen the AS3 version:
http://blog.soulwire.co.uk/flash/actionscript-3/as3-g94-circular-menu/
It uses Tweenlite and is much more configurable, so you should be able to achieve the effect in the image you sent me.
john
Feb 11th 2009
9:49 pm
Yes I did … but the project i am working on require as2 … anyway how to do this on as?
JOHN
Feb 12th 2009
7:28 am
Please!!
Soulwire
Feb 12th 2009
10:16 pm
Hi John,
Getting it running with Tweenlite will be very straight forward. Just import the class as the docs say and then replace all calls to the fuse tweens with the Tweenlite syntax. For example:
Would become
I don’t have time to work out the rest, but one approach (if you know how many menu items you will have) would be to build and array or predefined positions, like [ {x:100,y:100}, {x:90,y:120} ] and then use the btn.pos property to determine which position each item should tween to. This would be simpler than writing an algorithm for the configuration you’re after - so long as it is only going to have one use and not be a generalised script…
jhon
Feb 13th 2009
2:58 am
wow thanks a lot …
what about if i just want it to move up but not rotate it but just go in circle ..
something like this
one
two
three
four
five
cicit
Apr 17th 2009
5:40 am
Hello man, where in the script that I can find variables that control “AngleSpacing” like the scrollcontrol at your AS3 file?
Thanks
Cicit
mark
Apr 22nd 2009
9:02 am
hey Soulwire your are amazing,
i need help for something! I will use this menu as a sub menu so i need to activate and deactivate the menu. how would this work? OK active i have but deactivate is a problem. thx
pete
Jun 8th 2009
3:05 pm
when i try this menu, if i push the third button, the second one is still inactive, what is the reason of this?..
sorry but my english is so poor..
saludos…pete
pete
Jun 9th 2009
3:47 pm
why some times the venus button is deactivate?…
regards…
Giulio
Jun 17th 2009
4:18 pm
Hi Soulwire,
thanks for yor Circular menu, i’ve one question:
It’s possible create a buttons for each planet?
Saturn –gotoAndStop(25);
Uranus — gotoAndStop(35);
Mars — gotoAndStop(45);
etc.
Thank for you reply.
Giulio
Soulwire
Jun 17th 2009
4:34 pm
Sure Giulio,
You could put frame labels in your button MovieClip with the same names: “Mars”, “Saturn” etc then use this.gotoAndStop(name); in the CircNavBtn prototype (where it is currently setting the content of the TextField)
Giulio
Jun 17th 2009
9:50 pm
Hi soulwire,
i don’t understand, sorry, I was not to apply your tips.
Do you explain a example for better understand?
Thanks for your patience.
have a good day
Giulio
Soulwire
Jun 18th 2009
10:02 am
Hi Giulio,
So, in your btn MovieClip (in the library), add some frames on the timeline and make the frame labels the same as your name Array (Mercury, Venus, Earth, Mars… etc)
Then, replace the circNavBtn function with this one:
You can see, it’s going to tell the btn MovieClip to go to the frame with the label that is the same as the text that would normally appear in the button.
matasky
Jun 25th 2009
5:48 pm
Hi soulwire,
how can i pass a loadMovie to each button?
Thanks for your patience.
M
Leave a Reply