# \[MX\] Dynamic Scaling problem

**URL:** <https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369>\
**Category:** flash\
**Created:** [August 1, 2003, 4:01pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369 "2003-08-01T16:01:24Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keith130](https://avatars.discourse-cdn.com/v4/letter/k/b38774/32.png) [@Keith130](https://forum.kirupa.com/u/Keith130)\
**Post date:** [August 1, 2003, 4:01pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/1 "2003-08-01T16:01:24Z")

</div>

The following actionscript is some that I got from lostinbeta from an alpha fade question I had, that works fine but I now would like to have the movieclips get smaller at the same time as fading. So I put in some code that went like this

[AS]

//set the transform  
mc.\_xscale = (i_10);  
mc.\_yscale = (i_10);

[/AS]

That worked but the duplicated MC’s are all pointing to the starting point of the main “Ball” MC. I dont know how to fix it, as usall. Here is the bulk of the code :

[AS]

//define variable to hold how man clips there should be  
var i = 20;  
//put original clip on top of all duplicated clips  
ball.swapDepths(i);  
//create function to add multiple balls  
function addBall() {  
//if variable i is greater than 0  
if (i\>0) {  
//decrement it by 1  
i–;  
//duplicate the ball clip  
mc = ball.duplicateMovieClip(“ball”+i, i);  
//set the alpha  
mc.\_alpha = (i\*10);

```
//transform script here ?
			
			
    } else {
            //else if variable i isn't greater than 0
            //clear the interval (stop running this function)
            clearInterval(myInterval);
    }

```

}  
//set the interval and call the addBall function every 15 milliseconds  
myInterval = setInterval(addBall, 15);

[/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 1, 2003, 4:47pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/2 "2003-08-01T16:47:32Z")

</div>

[AS]var i = 20;  
ball.swapDepths(i);  
function addBall() {  
if (i\>0) {  
i–;  
mc = ball.duplicateMovieClip(“ball”+i, i);  
mc.\_alpha = (i_10);  
mc.\_xscale = (i_10);  
mc.\_yscale = (i\*10);  
} else {  
clearInterval(myInterval);  
}  
}  
myInterval = setInterval(addBall, 100);[/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 1, 2003, 5:20pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/3 "2003-08-01T17:20:10Z")

</div>

The problem with resizing this is simple… your tweens is contained in a movie clip symbol. When you scale down the movie clip symbol, it isn’t able to keep up with the original clip because the entire tween area is shrunk down with it.

I am guessing you would have to make the ball shape inside the ball movie clip symbol another movie clip symbol and then target that for the new settings, but im not sure. I don’t have time work on that right now. Sorry.

---

<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 1, 2003, 5:22pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/4 "2003-08-01T17:22:56Z")

</div>

The mc’s still radiate from the starting point of the ball though.

---

<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 1, 2003, 5:31pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/5 "2003-08-01T17:31:25Z")

</div>

Yeah, because you are duplicating the original clip, and when you do that, since you don’t set a new x and y position for the clip it generates at the original clips position.

---

<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 1, 2003, 5:45pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/6 "2003-08-01T17:45:15Z")

</div>

So how would i set a new x/y?

---

<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 1, 2003, 5:47pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/7 "2003-08-01T17:47:15Z")

</div>

One way:[AS]mc.\_x = (i_10);  
mc.\_y = (i_10);

```auto

```

---

<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 1, 2003, 5:52pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/8 "2003-08-01T17:52:17Z")

</div>

Even if you were to set a new xy position it still wouldn’t follow the right path. You are scaling the whole clip, so the whole path is shrinking as well.

Check my attachment to see it manually.

---

<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 1, 2003, 5:57pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/9 "2003-08-01T17:57:42Z")

</div>

I understand what your saying lost, any words of wisdom to overcome the problem?

---

<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 1, 2003, 6:01pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/10 "2003-08-01T18:01:17Z")

</div>

I have no clue, I tried converting the ball graphic inside the ball clip to a movieclip symbol, and it worked just great, but when I tried to edit the \_xscale and \_yscale size of that clip, the tween became obsolete and it wouldn’t work anymore.

I don’t know how to fix it, sorry.

---

<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 1, 2003, 6:07pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/11 "2003-08-01T18:07:20Z")

</div>

Never mind then

---

<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 1, 2003, 6:50pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/12 "2003-08-01T18:50:58Z")

</div>

> _Originally posted by lostinbeta_  
> \*\*I have no clue, I tried converting the ball graphic inside the ball clip to a movieclip symbol, and it worked just great, but when I tried to edit the \_xscale and \_yscale size of that clip, the tween became obsolete and it wouldn’t work anymore.

I don’t know how to fix it, sorry.\*\*

You were on the right track, all you had to do is convert it to MovieClip one more time. 😛

---

<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 1, 2003, 9:47pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/13 "2003-08-01T21:47:38Z")

</div>

Thanx a lot Kax!

---

<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 1, 2003, 10:18pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/14 "2003-08-01T22:18:49Z")

</div>

… Lost’s idea. 😉

But you’re welcome, anyway. 😛

---

<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 1, 2003, 11:45pm UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/15 "2003-08-01T23:45:01Z")

</div>

Interesting… good move kax, I honestly don’t think I would have been able to figure that out.

---

<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 2, 2003, 10:25am UTC](https://forum.kirupa.com/t/mx-dynamic-scaling-problem/27369/16 "2003-08-02T10:25:55Z")

</div>

Thanks both of you then (Happy Kax? 😛 )
