문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top