Scaling relative to mouse position

My actionscripting must be improving because I know the basics of this, just need a little help.

I have a dragable movie clip that on release I want to scale, depending on the mouse position, the further the mouse up the screen (y) then the smaller the clip scales on release.

Any help would be, as usual, appreciated.

Thanks folks

Maybe something like that, it prolly needs ajustments…

yourbutton.onRelease = function(){
myMousey = _root._mousey;
pourcent = myMousey*100/Stage.Height
yourMC._xscale = yourMC._yscale = pourcent}

Thanks, I’ll give that a try and let you know how I get on.

Nope. On release my movie clip disappears. I’ll have a closer look.

Is there a way of creating areas of scale as the mouse moves, ie: if the mouse is in a certain area, on release the clip scales to say 50%, if the mouse is in another area then it scales to 40%??

Little adjustment on Uli’s code
[AS]yourbutton.onRelease = function() {
myMousey = _root._ymouse;
pourcent = myMousey*100/Stage.height;
yourMC._xscale = yourMC._yscale=pourcent;


Currently I’m just using something like this.

on (release) {
if (this._y <= 195){
this._yscale = 95;
this._xscale = 95;

which seems to work well.

Yep, there are many ways of doing it:)