PDA

View Full Version : Zoom In & Zoom Out


Datincorp
06-10-2004, 10:42 AM
Hey guys, i would appreciate any help. I have a MC which i want to Zoom In as soon as the mouse is placed over it, and Zoom out when the mouse is not in touch with it. How do i do that ? sounds simple, but i have no idea...

Thanks !

Peace

Hassan :rolleyes:

Drakkon
06-10-2004, 11:19 AM
have you even tried the Tweening functions yet (requires MX2004 so hopefully you posted in the right forum)

view the attached file and have fun!

Datincorp
06-10-2004, 12:27 PM
Hey thanks, that helps a lot... but i cant have the movie clip zooming In forever, i want it to reach certain size, when it reaches that size it should stop zooming.... You know what i mean ? lol

Anyways, thanks a lot for your help...

Hassan

Drakkon
06-10-2004, 12:50 PM
http://www.oreillynet.com/pub/h/1047
readup here and the links he provided...will give you an idea how the function works and how you can make it do what you want :D
if you put this directly on the MC will do what your looking for i think:

this.onRollOver = function () {
xOver = new mx.transitions.Tween(this,"_xscale",Regular.easeOut,this._xscale,500,10);
yOver = new mx.transitions.Tween(this,"_yscale",Regular.easeOut,this._xscale,500,10);
}

this.onRollOut = function () {
xOut = new mx.transitions.Tween(this,"_xscale",Regular.easeOut,this._xscale,100,10);
yOut = new mx.transitions.Tween(this,"_yscale",Regular.easeOut,this._yscale,100,10);
}

Datincorp
06-11-2004, 09:33 PM
Hey guys, i have this MC which zooms In and out every time the mouse is palce on/out the MC. However i want this movie clip to be on top of all the other layers only when it zooms In, but go to its regular position (behind all the other layers) when it zooms out. Anyways, this is the code i have for the zoom in and out.

news.onRollOver = function () {
xOver = new mx.transitions.Tween(this,"_xscale",Regular.easeOut,this._xscale,200,10);
yOver = new mx.transitions.Tween(this,"_yscale",Regular.easeOut,this._xscale,200,10);
}

news.onRollOut = function () {
xOut = new mx.transitions.Tween(this,"_xscale",Regular.easeOut,this._xscale,100,10);
yOut = new mx.transitions.Tween(this,"_yscale",Regular.easeOut,this._yscale,100,10);
}


I WOULD REALLY APPRECIATE ANY HELP !!

THANKS !

HASSAN

CyanBlue
06-11-2004, 09:52 PM
Howdy and Welcome... :)

I think you should take a look at the function called swapDepths() from the forum or Flash manual since I think that's what you are looking for...

Please keep your question to ONE thread... Thank you...
(I am going to merge this thread back to your previous thread...)

farafiro
06-13-2004, 06:40 AM
yup, like cyan'snews.onRollOver = function() {
this.swapDepths(theMc)
xOver = new mx.transitions.Tween(this, "_xscale", Regular.easeOut, this._xscale, 500, 10);
yOver = new mx.transitions.Tween(this, "_yscale", Regular.easeOut, this._xscale, 500, 10);
};
news.onRollOut = function() {
_root.theMc.swapDepths(this)
xOut = new mx.transitions.Tween(this, "_xscale", Regular.easeOut, this._xscale, 100, 10);
yOut = new mx.transitions.Tween(this, "_yscale", Regular.easeOut, this._yscale, 100, 10);
};

Tink
06-13-2004, 07:26 AM
you may want to look into using 'onMotionChanged' to update the depth at certain points

http://www.actionscript.org/forums/showthread.php3?t=47955&highlight=onMotionChanged

farafiro
06-13-2004, 08:47 AM
and onMotionFinished
http://www.actionscript.org/tutorials/advanced/Tween-Easing_Classes_Documented/index.shtml