# Enlarge

**URL:** <https://forum.kirupa.com/t/enlarge/263571>\
**Category:** flash\
**Created:** [June 17, 2008, 10:42am UTC](https://forum.kirupa.com/t/enlarge/263571 "2008-06-17T10:42:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![iMike91](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@iMike91](https://forum.kirupa.com/u/iMike91)\
**Post date:** [June 17, 2008, 10:42am UTC](https://forum.kirupa.com/t/enlarge/263571/1 "2008-06-17T10:42:48Z")

</div>

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

Current code:

```auto

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)

---

<div class="post-metadata">

**Author:** ![neilmmm](https://avatars.discourse-cdn.com/v4/letter/n/ee7513/32.png) [@neilmmm](https://forum.kirupa.com/u/neilmmm)\
**Post date:** [June 17, 2008, 12:18pm UTC](https://forum.kirupa.com/t/enlarge/263571/2 "2008-06-17T12:18:12Z")

</div>

register the movieclip to the centre?

---

<div class="post-metadata">

**Author:** ![iMike91](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@iMike91](https://forum.kirupa.com/u/iMike91)\
**Post date:** [June 17, 2008, 12:27pm UTC](https://forum.kirupa.com/t/enlarge/263571/3 "2008-06-17T12:27:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 17, 2008, 12:31pm UTC](https://forum.kirupa.com/t/enlarge/263571/4 "2008-06-17T12:31:48Z")

</div>

tweenclass

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

---

<div class="post-metadata">

**Author:** ![iMike91](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@iMike91](https://forum.kirupa.com/u/iMike91)\
**Post date:** [June 17, 2008, 2:36pm UTC](https://forum.kirupa.com/t/enlarge/263571/5 "2008-06-17T14:36:07Z")

</div>

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]

```auto

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…

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 17, 2008, 2:50pm UTC](https://forum.kirupa.com/t/enlarge/263571/6 "2008-06-17T14:50:16Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![iMike91](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@iMike91](https://forum.kirupa.com/u/iMike91)\
**Post date:** [June 17, 2008, 11:14pm UTC](https://forum.kirupa.com/t/enlarge/263571/7 "2008-06-17T23:14:19Z")

</div>

If anyone is looking for more info about this:

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

Thank 🙂
