accordion class - flash actionscript3 (as3)
Posted by admin at 09/06/2008 at 11:52
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
Posted in : as3, Flash Demos 
|
6 Response’s to “accordion class - flash actionscript3 (as3)”
Leave a response:
HTML Tags Available: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
18 Oct 2008 om 6:39
Thank you very much for this blog post this is a great accordion the best one Ive found online thats easy to use.
16 Jan 2009 om 8:27
Great work. Stupid question, but how do you actually customise it to have your own content on each slide?
16 Jan 2009 om 13:56
inside your flash , in the library section you can see 2 sample movieclips
one for the panel, and one for the content.
build your own movieclips, name them and then in the code file , place your names instead of the samplePanel and sampleContent movieclips.
at the moment, this accordion actually kinda fixed to the sizes mentioned on the constructor (when you first create a new instance)
i have a minpulated version of it, more user friendly one, i need to fix some last issues on and post it here.
let me know if you handled it.
28 Jan 2009 om 17:06
Don’t you into problems naming your classes without a Capital letter at the start? That’s one of the first basics of object oriented programming.
01 Feb 2009 om 4:09
Thanks very much! Should have known that really… or at least fiddled a bit more before asking. But this time I have a question I am truly stumped on.
I am trying to add a hover button inside the navigation buttons - a simple little thing so that when I move my mouse over the buttons the text changes colour. A simple button symbol doesn’t work which I expected - but I am also having quite a bit of trouble doing this with code.
Any ideas?
Thanks a lot in advance.
Pat.
15 Feb 2009 om 18:13
Thank you very much! Need this one for a project, I’m happy finding scuh nice solution in here! :_)