# How make mc visible with AS, function

**URL:** https://forum.kirupa.com/t/how-make-mc-visible-with-as-function/40389
**Category:** Uncategorized
**Created:** [January 18, 2004, 3:49am UTC](https://forum.kirupa.com/t/how-make-mc-visible-with-as-function/40389 "2004-01-18T03:49:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![selassi](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@selassi](https://forum.kirupa.com/u/selassi)
#### Post date: [January 18, 2004, 3:49am UTC](https://forum.kirupa.com/t/how-make-mc-visible-with-as-function/40389/1 "2004-01-18T03:49:27Z")

</div>

hi,  
i have this script to animate my button.  
so fare it works fine. the buttons are mc and have three states: one for up, one for over and one for press.  
when first loading the swf, i want to have the first button already in the ‘press’ status.  
i tried to do it with this:  
but1.mc\_butup.\_visible = false;  
but that confuses my function of the button states.  
Any help is appreciated. Thank you  
\_selassi  
this is the scrip i have so far:

```auto
var buttonActive;
_global.buttonRelease = function(which) {
if (buttonActive != nil) {
with (buttonActive) {
mc_butover._visible = false;
mc_butup._visible = true;
}
}
};
for (i=1; i<=4; i++) {
with (_root["but"+i]) {
butOn = false;
mc_butover._visible = false;
}
_root["but"+i].onPress = function() {
_global.buttonRelease(buttonActive);
this.mc_butup._visible = false;
this.mc_butover._visible = false;
butOn = true;
buttonActive = this;

};
_root["but"+i].onRollOver = function() {
if (buttonActive != this) {
this.mc_butover._visible = true;
} else {
this.mc_butover._visible = false;
}
};
_root["but"+i].onRollOut = function() {
this.mc_butover._visible = false;
};
}

```
