Enlarge

How do I enlarge a pic when on(rollOver)?

Current code:


on (rollOver) {
	
	_root.pop(2, _root.box); [COLOR="Red"][COLOR="Lime"](<--not related to enlarging)[/COLOR][/COLOR]
	setInterval (_root.enlarge(), 1000);
	
}
on (rollOut) {
	unloadMovieNum(1);
	setProperty(_root.box, _xscale, "100");
	setProperty(_root.box, _yscale, "100");
	
}


function enlarge() {
	if (_root.box._yscale<150) {
		setProperty(_root.box, _xscale, _root.box._xscale + 10);
		setProperty(_root.box, _yscale, _root.box._yscale + 10);
		
	}
		else {
		clearInterval;
		}
	
}

and how do I make it enlarge equally in all directions (meaning not just to 4th quarter on x,y scale)

register the movieclip to the centre?

what is the script? and not to the center. i have multiple icons, and i want when rollOver that they will enlarge gradually…

tweenclass

getting images to resize symmetrrically is difficult, advise search forums as it does come up a fair bit

I am trying to enlarge it without tweening (i have no clue how to script that:( )
but then I get the following error message:

[COLOR=“Red”]
Error Scene=Scene 1, layer=Layer 1, frame=1:Line 14: Statement must appear within on/onClipEvent handler
function enlarge() {

Total ActionScript Errors: 1 Reported Errors: 1
[/COLOR]


var i = 0;
on(rollOver) {
	setInterval(enlarge(), 1000);
}
[COLOR="Purple"]This part is supposed to reduce enlargement,
 ill finish this part after ill know how to enlarge properly 
- and then ill do the exact opposite to reduce enlargement.. :)[/COLOR]
on(rollOut) {
	setProperty(_root.box, _width, _root.box._width -50);
	setProperty(_root.box, _x, _root.box._x + 25);
	
	setProperty(_root.box, _height, _root.box._height -50);
	setProperty(_root.box, _y, _root.box._y + 25);
	}

	function enlarge() {
		
		if (i < 5) {
			setProperty(_root.box, _width, _root.box._width +50);
			setProperty(_root.box, _x, _root.box._x - 25);
	
			setProperty(_root.box, _height, _root.box._height +50);
			setProperty(_root.box, _y, _root.box._y - 25);
		i = i+1;
		}
                      else {
                         clearInterval;
                  }
	}
		
			

Please help me, I need to finish this small project already…

well if you are doing it wrong there is no point

google tween class its simple there are tuts on the main page and simular topics on this board

tween(MC,xscale,start,finish,duration, true)
tween(MC,yscale,start,finish,duration, true)

If anyone is looking for more info about this:

http://www.adobe.com/devnet/flash/articles/tweening_01.html [COLOR=“Red”]Explains everything about Tweening :)[/COLOR]

Thank :slight_smile: