FORUMS: list search recent posts

Buttons .. show/hide movieclips

COW Forums : Adobe Flash

Respond to this post   •   Return to posts index   •   Read entire thread

Daniel Trotter
Buttons .. show/hide movieclips
on Aug 12, 2011 at 4:05:50 pm

Hi guys,

New here and new to AS3 so wondering if any of you could assist with a little problem I'm facing.

Basically I have 3 buttons with 3 different movieclips, currently when I click a button it plays a particular movieclip.
The movieclip only dissappears if I click the same button again.
If I click one of the other buttons without clicking the first again it goes over the top of the other or under depending on which layer it is.
I've tried to make it so when I click one button the other movieclips are hidden but I've got to the point where I'm now cross-eyed and struggling to make sense of my code or logic :(

Any advice would be fantastic :)

AES_btn.addEventListener(MouseEvent.CLICK, aesButtonClick);
AMT_btn.addEventListener(MouseEvent.CLICK, amtButtonClick);
WBSS_btn.addEventListener(MouseEvent.CLICK, wbssButtonClick);

function aesButtonClick(event:MouseEvent):void{MovieClip(this.parent).AES_frame.visible=true;MovieClip(this.parent).play();MovieClip(this.parent).AMT_frame.visible=false;MovieClip(this.parent).WBSS_frame.visible=false;}
function amtButtonClick(event:MouseEvent):void{MovieClip(this.parent).AMT_frame.visible=true;MovieClip(this.parent).play();MovieClip(this.parent).AES_frame.visible=false;MovieClip(this.parent).WBSS_frame.visible=false;}
function wbssButtonClick(event:MouseEvent):void{MovieClip(this.parent).WBSS_frame.visible=true;MovieClip(this.parent).play();MovieClip(this.parent).AES_frame.visible=false;MovieClip(this.parent).AES_frame.visible=false;}

Posts IndexRead Thread 

Current Message Thread:

© 2018 All Rights Reserved