ActionScript 2 Accordion Menu
This is an ActionScript 2 version of the ActionScript 3 Accordion Menu.
This version is far far less feature complete than the ActionScript 3 version. This version was a “proof” of concept if you like of how I would approach making an Accordion Menu, which I then used as conceptual direction when making the ActionScript 3 version.
Nevertheless, it is an XML Accordion, but does not support function calls from the XML file. It is also not class based, and instead relies on two fairly simple sections of timeline actionScript to generate its functionality. The two .fla files have good comments and directions on what to edit to make changes to the ActionScript.
If there is demand, I can finish this menu to the level of the ActionScript 3 version.
View Example
Here is an example of the menu; http://www.noponies.com/dev/as2_accordion/
Source Files
Here are the source files; ActionScript 2 Accordion Menu Source
Dependencies
The menu uses Tweener. Its an old file, that I have not update to tweenLite.

May 23rd, 2008 at 4:41 am
Hey buddy,
I gotta say, I love your code! And yes, if it’s possible to make the AS 2 version as feature rich as its AS 3 sibling, that would make me more than happy! Unfortunately, myboss wants everything to be Flash 8 – preferrably Flash 7 – compatible!
Cheers!
May 24th, 2008 at 3:58 pm
Dom,
Sorry, I doubt I’ll do any work on this example. Not unless is a paid job.
July 3rd, 2008 at 5:09 am
Hello,
This is just what I need. Thanks so much for your effort, and sharing this.
I have a little question that I need to ask.
I am loading swf’s instead of images to this accordion manu. When I rollover, a swf pops up below. Everythings fine. But, in the swf there are buttons and they are not working.
I think, the controls of container has all coordinates and the pointer can not touch my inner swf buttons. What can I do? A little tip please..
Thanks again.
July 7th, 2008 at 12:51 am
Hi,
I am still working on this swf buttons problem. I think I need your help.
July 9th, 2008 at 11:59 am
John,
AS2 is a real pain in the ass to deal with button actions on nested clips. The only way around it is to use a hittest via a mouseListener. Honestly, you would be better off moving to AS3.
July 10th, 2008 at 2:38 pm
Thanks Dale,
I tried hitArea for seeing bar for a hit. But not working. Will try hittest and code something extra to modify with that.
Thanks again for this code.
Ps: I have no time for learning as3. I hope some day.. as3 and papervision.
Thanks.
July 28th, 2008 at 10:27 am
How would you make this so when it loads a particular item is open… lets say menu item 1, the first one is open as if it was rollover by default?
Nice code!
July 28th, 2008 at 1:26 pm
Noisey,
Not in the AS2 version no. That feature is present in both the AS3 versions here. I try not to do anything to do with AS2 anymore.
July 29th, 2008 at 8:00 am
Yeah unfortunately AS3 isn’t an option… I wish it was.
Still wondering if there is the possibility to make this open with 1 item expanded as default.
July 30th, 2008 at 7:31 am
Hmm do you think there is a way to make the accordion think that a certain item is being hovered over by fiddling with the currentMc variable?
July 31st, 2008 at 7:49 am
If I add in:
var currentMc = _root.menubar0;
rolledOver(currentMc);
to the very end of the mclListener.onLoadInit it will open the first one, but the image isn’t loaded, if I change to menubar1 then the 2nd opens, menubar2 would be the third…etc.. The problem is it doesn’t load the image. but it doesnt extend the menu. I’ve tried placing this elsewhere with no luck. I am missing something….
July 31st, 2008 at 2:38 pm
Ok, the image should load.
You need a method to broadcast to the menu items what one you want to open.
You could do that using the AsBroadcaster class.
August 6th, 2008 at 12:49 pm
Bare with me I am still green at AS2.
So I add in:
var currentMc = _root.menubar0;
targetThumbs.broadcastMessage(rolledOver(currentMc));
the end of mclListener and the same thing happens. It opens the first one on load but the images don’t show up.
June 1st, 2009 at 11:17 am
Thanks For this its great just what i need, also wanted to say that i really like your illustration, lovely style.
big up your bad self.
Thanks.
Peter
June 1st, 2009 at 12:48 pm
i actually dont need this menu to display image but just text, is it possible to use the caption option for this ?
Regards
Peter
July 5th, 2010 at 10:59 am
Thank you very very x1000 much