# Change \_x \_y scale over time

**URL:** <https://forum.kirupa.com/t/change--x--y-scale-over-time/5826>\
**Category:** flash\
**Created:** [September 23, 2002, 2:56am UTC](https://forum.kirupa.com/t/change--x--y-scale-over-time/5826 "2002-09-23T02:56:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sintax321](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@sintax321](https://forum.kirupa.com/u/sintax321)\
**Post date:** [September 23, 2002, 2:56am UTC](https://forum.kirupa.com/t/change--x--y-scale-over-time/5826/1 "2002-09-23T02:56:13Z")

</div>

Does anyone know of a way to change the x and y scale of a MC over time so it looks animated with AS. I don’t want to build tweens so I was wondering if there was an AS way of doing it. I just want a MC to look like it is slowly shrinking when a button is pressed.

---

<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:** [September 23, 2002, 4:32am UTC](https://forum.kirupa.com/t/change--x--y-scale-over-time/5826/2 "2002-09-23T04:32:10Z")

</div>

easily done

place this code on the movieclip in question

onClipEvent(load){  
this.flag=false;  
}  
onClipEvent(enterFrame){  
if (this.flag==true){  
if(this.\_yscale\>0){  
this.\_xscale–;  
this,\_yscale–;  
}  
}  
}

then just add into your “on press” code on the button, something like this

theNameOfMyMovieClip.flag=true;

where theNameOfMyMovieClip is the instance name of the movie clip including a logical path to that object.

ie if the movie clip is on the main timeline, you could use  
\_root.instanceName.flag=true;

or if it’s inside another movie clip you could use  
\_root.mcNumber1.mcNumber2.flag=true;

---

<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:** [September 23, 2002, 2:22pm UTC](https://forum.kirupa.com/t/change--x--y-scale-over-time/5826/3 "2002-09-23T14:22:00Z")

</div>

Thanks david:) I’ll give it a try when I get off work.
