# AS2 problem

**URL:** https://forum.kirupa.com/t/as2-problem/277969
**Category:** flash
**Created:** [December 19, 2008, 1:47pm UTC](https://forum.kirupa.com/t/as2-problem/277969 "2008-12-19T13:47:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![marcelomdsc](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@marcelomdsc](https://forum.kirupa.com/u/marcelomdsc)
#### Post date: [December 19, 2008, 1:47pm UTC](https://forum.kirupa.com/t/as2-problem/277969/1 "2008-12-19T13:47:19Z")

</div>

Hello I´m having problems with a simple as2 piece of code…

//Hide Close Button  
cerrar\_mc.\_visible = false;

//Show Close Button  
text\_bg.onRollOver = function():Void{  
cerrar\_mc.\_visible = true;  
};  
text\_bg.onRollOut = function():Void{  
cerrar\_mc.\_visible = false;  
};

//Drag Text  
text\_bg.onPress = function():Void{  
this.\_parent.startDrag(false, -325, -140, 420, 280);  
};  
text\_bg.onRelease = function():Void{  
this.\_parent.stopDrag();  
};  
text\_bg.onReleaseOutside = function():Void{  
this.\_parent.stopDrag();  
};

What I need the code to do is to make text\_bg drag, and show cerrar\_mc on rollover.  
cerrar\_mc is a close button which unloads the movie on that level.  
The problem is that when i rollover text\_bg, cerrar\_mc is visible but when i rollover it, it disappears.

Is there anything wrong with the code?  
thanks.
