Mouse over effects

Can someone explain this to me in steps… If you click here 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

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.

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

no prob. hope it works.

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