# Movieclip rollovers appear in next frame

**URL:** <https://forum.kirupa.com/t/movieclip-rollovers-appear-in-next-frame/39870>\
**Category:** flash\
**Created:** [January 12, 2004, 9:42am UTC](https://forum.kirupa.com/t/movieclip-rollovers-appear-in-next-frame/39870 "2004-01-12T09:42:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carixpig](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/carixpig/32/304_2.png) [@Carixpig](https://forum.kirupa.com/u/Carixpig)\
**Post date:** [January 12, 2004, 9:42am UTC](https://forum.kirupa.com/t/movieclip-rollovers-appear-in-next-frame/39870/1 "2004-01-12T09:42:44Z")

</div>

Hi all,

I’ve got his code on movieclips on my portfolio: [http://www.mucreative.com/chris\_portfolio.html](http://www.mucreative.com/chris_portfolio.html)

It is used in the graphics section for some rollOvers, but you’ll notice that each time you move to the next frame, the last mc that you rolled on stays visible. I’ve tried removing the swapDepths action from the script below but it doesn’t make any difference. (the variable “spring” is defined in the first frame - about .2).

[AS]  
onClipEvent (load){  
this.\_xscale = this.\_yscale = 80;  
this.targetScale = 60;  
}  
onClipEvent (enterFrame) {  
diff = this.targetScale-this.\_xscale;  
growth = diff\*\_root.spring;  
this.\_xscale += growth;  
this.\_yscale += growth;  
}  
on (rollOver){  
this.targetScale = 80;  
this.swapDepths(4);  
}  
on (rollOut, release, dragOut){  
this.targetScale = 60;  
}  
[/AS]

Thanks
