# AS3: Need active states for movieClip buttons

**URL:** <https://forum.kirupa.com/t/as3-need-active-states-for-movieclip-buttons/282923>\
**Category:** Uncategorized\
**Created:** [February 27, 2009, 7:27pm UTC](https://forum.kirupa.com/t/as3-need-active-states-for-movieclip-buttons/282923 "2009-02-27T19:27:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wuzzi2ya](https://avatars.discourse-cdn.com/v4/letter/w/e79b87/32.png) [@wuzzi2ya](https://forum.kirupa.com/u/wuzzi2ya)\
**Post date:** [February 27, 2009, 7:27pm UTC](https://forum.kirupa.com/t/as3-need-active-states-for-movieclip-buttons/282923/1 "2009-02-27T19:27:27Z")

</div>

Below is the code I have for my buttons. I have 3 different swfs loading in once each corresponding button is selected (CLICK). I also have rollover and rollout or idle states. Now the dilemma: Once a button (mc) is selected (CLICK) I need it to remain in its rollover state. Once another button is selected I need the previously highlighted button to switch to idle state and the new button to be highlighted… Sounds like the most basic, simple, AS3 101 question, but alas I am hitting a wall. Based on my provided code what is the best option for this, an array with an active state on the timeline, a toggle with Boolean ect, ect…?

Please help, any and all assistance is as always greatly appreciated… :thumb2:

```auto
var Hotspots:Loader = new Loader();
addChild(Hotspots);
moreInfo_btn.alpha = .5;
moreInfo_btn.buttonMode=true;
moreInfo_btn.addEventListener(MouseEvent.CLICK,getInfo);
moreInfo_btn.addEventListener(MouseEvent.MOUSE_OVER,changeColor);
moreInfo_btn.addEventListener(MouseEvent.MOUSE_OUT,changedColor);
function getInfo(MouseEvent):void {
        Mouse.show();
        rotate_mc.alpha = 0;
        Hotspots.load(new URLRequest("HiltiCallouts.swf"));
        Hotspots.y = 20;
}
function changeColor(MouseEvent):void {
        moreInfo_btn.alpha = 1;
}
function changedColor(MouseEvent):void {
        moreInfo_btn.alpha = .5;
}
 
rotate_btn.buttonMode=true;
rotate_btn.alpha = .5;
rotate_btn.addEventListener(MouseEvent.CLICK,gotoRotate);
rotate_btn.addEventListener(MouseEvent.MOUSE_OVER,changeColor1);
rotate_btn.addEventListener(MouseEvent.MOUSE_OUT,changedColor1);
 
function gotoRotate(MouseEvent):void {
        Mouse.show();
        rotate_mc.alpha = 0;
        rotate_btn.alpha = 1;
        Hotspots.load(new URLRequest("Hilti-Rotation.swf"));
        Hotspots.y = 40;
}
function changeColor1(MouseEvent):void {
        rotate_btn.alpha = 1;
}
function changedColor1(MouseEvent):void {
        rotate_btn.alpha = .5;
}
 
magnify_btn.buttonMode=true;
magnify_btn.alpha = .5;
magnify_btn.addEventListener(MouseEvent.CLICK,gotoZoom);
magnify_btn.addEventListener(MouseEvent.MOUSE_OVER,changeColor2);
magnify_btn.addEventListener(MouseEvent.MOUSE_OUT,changedColor2);
 
function gotoZoom(MouseEvent):void {
        rotate_mc.alpha = 0;
        Hotspots.load(new URLRequest("Hilti-Magnify.swf"));
        Hotspots.y = 0;
}
function changeColor2(MouseEvent):void {
        magnify_btn.alpha = 1;
}
function changedColor2(MouseEvent):void {
        magnify_btn.alpha = .5;
}

```
