# RollOver and RollOut Movieclip

**URL:** <https://forum.kirupa.com/t/rollover-and-rollout-movieclip/61239>\
**Category:** Uncategorized\
**Created:** [August 17, 2004, 6:02am UTC](https://forum.kirupa.com/t/rollover-and-rollout-movieclip/61239 "2004-08-17T06:02:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanvi](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tanvi](https://forum.kirupa.com/u/tanvi)\
**Post date:** [August 17, 2004, 6:02am UTC](https://forum.kirupa.com/t/rollover-and-rollout-movieclip/61239/1 "2004-08-17T06:02:35Z")

</div>

Hi guys,

Help me with this problem…  
I have a [color=red]button[/color] which on [color=red]ROLLOVER[/color] shows a [color=red]MOVIECLIP[/color] on the stage and on [color=red]ROLLOUT[/color] it should remove it from the stage.  
Check out this code which perfectly works as i want

[color=blue]on (rollOver) {  
[color=gray]//Movieclip GotoAndPlay Behavior  
[/color] this.Teal.gotoAndPlay(“2”);  
[color=gray]//End Behavior  
[/color]}  
on (rollOut) {  
removeMovieClip(this.Teal);  
[color=gray]//End Behavior  
[/color]}  
[/color]  
[color=black]but my problem is wen i go back to same button after a rollover, the movie clip doesnt show or code does not respond.[/color]  
[color=black][/color]  
[color=blue][color=black]Where did i go wrong pls tell.[/color][/color]  
[color=blue][color=#000000][/color][/color]  
[color=blue][color=#000000]Thank You[/color]  
[/color]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 17, 2004, 6:19am UTC](https://forum.kirupa.com/t/rollover-and-rollout-movieclip/61239/2 "2004-08-17T06:19:20Z")

</div>

> [@tanvi](#):
>
> Hi guys,
> 
> Help me with this problem…  
> I have a [color=red]button[/color] which on [color=red]ROLLOVER[/color] shows a [color=red]MOVIECLIP[/color] on the stage and on [color=red]ROLLOUT[/color] it should remove it from the stage.  
> Check out this code which perfectly works as i want
> 
> [color=blue]on (rollOver) {  
> [color=gray]//Movieclip GotoAndPlay Behavior  
> [/color] this.Teal.gotoAndPlay(“2”);  
> [color=gray]//End Behavior  
> [/color]}  
> on (rollOut) {  
> removeMovieClip(this.Teal);  
> [color=gray]//End Behavior  
> [/color]}  
> [/color]  
> [color=black]but my problem is wen i go back to same button after a rollover, the movie clip doesnt show or code does not respond.[/color]  
> [color=black][/color]  
> [color=blue][color=black]Where did i go wrong pls tell.[/color][/color]  
> [color=blue][color=#000000][/color][/color]  
> [color=blue][color=#000000]Thank You[/color]  
> [/color]

guess you have attached the mc dynamically at some point, well now you have removed it. Maybe put the attachMovie code in you rollOver.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 17, 2004, 6:52am UTC](https://forum.kirupa.com/t/rollover-and-rollout-movieclip/61239/3 "2004-08-17T06:52:23Z")

</div>

yeh when u remove a movie clip it is permenantly removed and u have to attach it again. instead, just use this.

onClipEvent (load) {  
[color=Black] this.Teal[/color].\_visible = false;  
}  
[color=Black]on (rollOver) {  
this.Teal.\_visible = true;  
}  
on (rollOut) {  
[/color][color=Black] this.Teal.\_visible = false;[/color][color=Black]  
}

this will set it be visible when u rollout and invisible when ur not on it.

[/color]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 17, 2004, 7:01am UTC](https://forum.kirupa.com/t/rollover-and-rollout-movieclip/61239/4 "2004-08-17T07:01:42Z")

</div>

hey guys thank you for your reply but i got the code and it works absolutely fine…

on (rollOver) {  
//Movieclip GotoAndPlay Behavior  
this.ActionClip.gotoAndPlay(“1text”);  
//End Behavior  
}  
on (rollOut) {  
//Movieclip GotoAndPlay Behavior  
this.ActionClip.gotoAndPlay(“1back”);  
//End Behavior  
}  
where actionclip is my movie instance name and 1back is framename in ActionClip movieclip.  
Thanks again  
LOL
