in flash as3 you don’t have any accordion component, not that i like using those components,i’d prefer use a nicely written code instead :)

so there i was looking for a vertical accordion for one of my works, i came accross this nice class, that does everything in a very simple code. the only problem i found it that it had only a horizontal version…

looking at the comments i saw there is a need for a vertical one,

so i fixed the code in a way that it can work both ways.

the new accordion constructor has an extra of 2 parameters :

public function accordion($width:Number, $height:Number, panelNumber:Number=0, navWidth:Number=0,navHeight:Number=0,allignment:Boolean=false)

the navHeight - represent the height of the navigation panel for Vertical mode,

and the alignment flag - false is for horizontal, and true … welp you’ll figure that out yourself.

the only thing left open in working with 2 accordions one inside the other :), i’ve managed to get that one going, but there is a problem with something not allowing the inner accordions btns to work as supposed. i’ll try to give it my time soon.

anyway great thanks to the one who wrote it, feel free to give the original page a visit.

download the sourcecode for my version : vertical and horizontal accordion source code

 

tag Posted in : as3, Flash Demos  | comment