# Mouse over effects

**URL:** https://forum.kirupa.com/t/mouse-over-effects/57213
**Category:** Uncategorized
**Created:** [July 11, 2004, 1:39pm UTC](https://forum.kirupa.com/t/mouse-over-effects/57213 "2004-07-11T13:39:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fiery\_rockstar](https://avatars.discourse-cdn.com/v4/letter/f/e99b99/32.png) [@fiery\_rockstar](https://forum.kirupa.com/u/fiery_rockstar)
#### Post date: [July 11, 2004, 1:39pm UTC](https://forum.kirupa.com/t/mouse-over-effects/57213/1 "2004-07-11T13:39:00Z")

</div>

Can someone explain this to me in steps… If you click [here](http://www.vapour-music.co.uk) and look at the little intro animation. I want to make it so that whenever someone clicks on an image it gets bigger, then whenever they press a close button it goes back to its normal position. Can someone explain this slowly with the code?

Thanx, J

---

<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: [July 11, 2004, 9:39pm UTC](https://forum.kirupa.com/t/mouse-over-effects/57213/2 "2004-07-11T21:39:29Z")

</div>

I have a pretty good idea, but i’m writing it on the fly, so it might not work right.

Basically, you want each image to expand…

That can be done like this:  
on(release){  
expandID = setInterval(expand, this);  
}  
function expand(button:Button){  
//When you want the button to stop expanding, like at 150% the original size  
//You do something like this:  
if(button.\_xcale \>= 150){  
clearInterval(expandID);  
}  
//And for the expanding code:  
button.\_xscale += 10;  
button.\_yscale += 10;  
}

Now, the part I can’t really remember…

You need to use swapDepths() so that the image you’re expanding goes over the other images.

But I forget how to do that.

For the shrinking code, it’d be the same as the expand, except instead of \_xscale += 10; it’d be -= 10;

Hope this helps. I think you should be able to use it… in the meantime i’ll try and hunt down the thing I did a while ago that does this. Sorry I can’t be more helpful.

---

<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: [July 11, 2004, 9:42pm UTC](https://forum.kirupa.com/t/mouse-over-effects/57213/3 "2004-07-11T21:42:47Z")

</div>

Thats great thanx, ill give it a shot tomorrow and see how it goes 🙂

---

<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: [July 11, 2004, 9:46pm UTC](https://forum.kirupa.com/t/mouse-over-effects/57213/4 "2004-07-11T21:46:16Z")

</div>

no prob. hope it works.

---

<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 2, 2004, 12:16am UTC](https://forum.kirupa.com/t/mouse-over-effects/57213/5 "2004-08-02T00:16:48Z")

</div>

Finally got round to actually using that code… and I can’t get it to work :(… the images just don’t expand
