# Make a circle getting bigger

**URL:** https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447
**Category:** flash
**Created:** [August 13, 2003, 8:57pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447 "2003-08-13T20:57:51Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![tast](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@tast](https://forum.kirupa.com/u/tast)
#### Post date: [August 13, 2003, 8:57pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/1 "2003-08-13T20:57:51Z")

</div>

Hope that anyone can helt me make a little action script,-  
that take a “movie” and scale it from zero to 100%  
Just like if u would do it with a “Motion Tween”.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 13, 2003, 9:09pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/2 "2003-08-13T21:09:55Z")

</div>

onClipEvent(enterFrame) {  
if(\_alpha \< 100) { //wrong code  
\_alpha++; //wrong code  
} //wrong code  
} //wrong code

Add these actions to the movieclip (circle)!  
make sure you set the alpha 0 too!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 13, 2003, 9:14pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/3 "2003-08-13T21:14:45Z")

</div>

don’t you mean \_xScale and \_yScale, Syko?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 13, 2003, 9:30pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/4 "2003-08-13T21:30:09Z")

</div>

I´ve found this code, andi works well,-  
But how do i make it stop at a serten point.  
Let´s say it has scailed the picture 150,- then i want it to stop.

onClipEvent (load)  
{  
z=0;  
zspeed=5;  
fl=10;  
}  
onClipEvent(enterFrame)  
{  
scale=fl/(fl+z);  
\_xscale=\_yscale=150\*scale;  
z-=zspeed;  
}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 13, 2003, 9:49pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/5 "2003-08-13T21:49:37Z")

</div>

onClipEvent(enterFrame)  
{  
if (\_xscale\<=150) {  
scale=fl/(fl+z);  
\_xscale=\_yscale=150\*scale;  
z-=zspeed;  
}  
}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 14, 2003, 5:16am UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/6 "2003-08-14T05:16:01Z")

</div>

lol jsk! I must be going nuts! Yes I meant Xscale and Yscale!  
lol!  
No more coffee to me!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 14, 2003, 6:32am UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/7 "2003-08-14T06:32:09Z")

</div>

You can use the easing equation inscalling. That way the scalling is smoother:

Make sure that the movie clip you want to scale has a smaller scale percentage than myXscale and myYscale.

```auto

onClipEvent(load){
//change these values to the amount in scalling percentage.
  myXscale = 100; 
  myYscale = 100;
}
onClipEvent(enterFrame){
_xscale += (myXscale - _xscale)/3;
_yscale += (myYscale - _yscale)/3;
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 14, 2003, 12:51pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/8 "2003-08-14T12:51:44Z")

</div>

And there’s no need to calculate the focal length unless you want to do some more advanced perspective effects 🙂

```auto
onClipEvent(enterFrame)
{
if (_xscale<=150) {
_xscale=_yscale += 5 ;
}
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 15, 2003, 4:26am UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/9 "2003-08-15T04:26:09Z")

</div>

Oh and that too! 😛  
I thought there’s something wrong with my script… whew!

🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 15, 2003, 7:00am UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/10 "2003-08-15T07:00:11Z")

</div>

onClipEvent(enterFrame)  
{  
if (\_xscale\<=150) {  
scale=fl/(fl+z);  
\_xscale=\_yscale=150\*scale;  
z-=zspeed;  
}  
}

what exactly does this code that jsk posted do? does it ease up to 150? or am i wrong

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 15, 2003, 8:01am UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/11 "2003-08-15T08:01:54Z")

</div>

onClipEvent(enterFrame){  
(\_xscale\<100)?(\_xscale+=3;\_yscale+=3): (\_xscale=\_yscale=100)  
}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 15, 2003, 8:02am UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/12 "2003-08-15T08:02:47Z")

</div>

same thing

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 15, 2003, 5:31pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/13 "2003-08-15T17:31:59Z")

</div>

I´m all new to this Action script,-  
and after getting all the results of this question, i´ve tryed to play around with this:

onClipEvent(enterFrame)  
{  
if (\_xscale\<=150) {  
\_xscale=\_yscale += 5 ;  
}  
}

and changed it to this:

onClipEvent(enterFrame)  
{  
if (\_alpha\<=100) {  
\_alpha -= 5 ;  
}  
}

It make a picture fade out,-  
HOW do i make it fade out and then fade in???

No matter what i do i can´t make come back!!!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 18, 2003, 12:25pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/14 "2003-08-18T12:25:55Z")

</div>

try this

[AS]

onClipEvent (load)

{

```
    _alpha = 4;

```

reached100=false  
}

onClipEvent (enterFrame)

```
{

```

if ((\_alpha\<100) and (reached100==false)){  
\_alpha+=2;  
}  
else {  
if(\_alpha!=0){  
reached100=true  
\_alpha-=2;  
}

}

} [/AS]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 18, 2003, 12:37pm UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/15 "2003-08-18T12:37:26Z")

</div>

If we’d just want to fade out and in, I’d do it like this:

```auto

MovieClip.prototype.fade_out_in = function()
{
	this._alpha = 100;
	direction = -1;
	
	this.onEnterFrame = function()
	{
		if (this._alpha > 100 || this._alpha < 0)
		{
			if (direction == -1) 
			{
				// At this point the photo is invisible
				// So if you'd want you could change it ;P
				direction = 1;
			}
			else delete this.onEnterFrame; 
		}
		this._alpha += (2*direction);
	}
}
	
photo_mc.fade_out_in();

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2003, 11:13am UTC](https://forum.kirupa.com/t/make-a-circle-getting-bigger/28447/16 "2003-08-19T11:13:24Z")

</div>

> \*Originally posted by jugnu \*  
> \*\*onClipEvent(enterFrame){  
> (\_xscale\<100)?(\_xscale+=3;\_yscale+=3): (\_xscale=\_yscale=100)  
> } \*\*  
> Let’s be serious…

And there are a few more methods here: [http://www.kirupaforum.com/forums/showthread.php?s=&threadid=4016](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=4016)
