1

im working on a accordion menu on flash cs 6 but i dont want to do complete animation for each option beacause it takes a lot of time. i think in previous versions there was an accordion option in components but now there is not. this is what i tried for updown menu:

 sub1.visible = false;

sub1.addEventListener(MouseEvent.MOUSE_OVER,drop1);

sub1.addEventListener(MouseEvent.MOUSE_OUT,up1);

btn1.addEventListener(MouseEvent.MOUSE_OVER,drop1);

btn1.addEventListener(MouseEvent.MOUSE_OUT,up1);


function drop1(e:MouseEvent){

sub1.visible = true;

}

function up1(e:MouseEvent){

sub1.visible = false;

}
/////////////////////////////////////////
sub2.visible = false;

sub2.addEventListener(MouseEvent.MOUSE_OVER,drop2);

sub2.addEventListener(MouseEvent.MOUSE_OUT,up2);

btn2.addEventListener(MouseEvent.MOUSE_OVER,drop2);

btn2.addEventListener(MouseEvent.MOUSE_OUT,up2);


function drop2(e:MouseEvent){

sub2.visible = true;

}

function up2(e:MouseEvent){

sub2.visible = false;

}

how can i make it easy? thank you for helping

virtouso
  • 549
  • 11
  • 30
  • Are you trying to implement an Accordion yourself? These can be quite complex components to build, even for someone with good knowledge of ActionScript. Why not have a look around and find a third party component you can use instead? You should be able to set the duration of any animations fairly easily. – net.uk.sweet Jan 26 '14 at 22:03
  • @net.uk.sweet i searched wel but i found nothing really good and straightforward – virtouso Jan 26 '14 at 22:08

1 Answers1

1

An accordion can be quite a tricky component to implement, even for someone with a good knowledge of ActionScript. As such, rather than wasting time attempting to write one yourself, I would suggest you find a third-party component you can use.

There are probably an abundance of free, third-party component sets out there, but you might start by having a look at minimalcomps by Keith Peters which includes an accordion component which sounds like it might be a good fit for your requirements (ie. there is no transition on the expand / retract). You can see it in action here and the code behind it here.

net.uk.sweet
  • 12,444
  • 2
  • 24
  • 42
  • That's what I mean - an accordion is not a trivial thing to build properly. If you decide you don't want to use the one I've referenced, it might be a good starting point for building your own since, as the name suggests, it's quite minimal ;) – net.uk.sweet Jan 27 '14 at 11:47