# Xscale problem

**URL:** <https://forum.kirupa.com/t/xscale-problem/124209>\
**Category:** Uncategorized\
**Created:** [September 30, 2004, 10:22pm UTC](https://forum.kirupa.com/t/xscale-problem/124209 "2004-09-30T22:22:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dru\_nasty](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dru\_nasty](https://forum.kirupa.com/u/dru_nasty)\
**Post date:** [September 30, 2004, 10:22pm UTC](https://forum.kirupa.com/t/xscale-problem/124209/1 "2004-09-30T22:22:43Z")

</div>

I’ve just got a simple mc on stage of a rectangle.  
I want the clip to go from its full width, then scale down to nothing and stop.

```auto

onClipEvent(enterFrame) {
this._xscale-=5;
}

```

The above code starts what I want, but I don’t want it to continue into the negative.(if that makes sense)  
So I came up with this but its not working:

```auto

onClipEvent(load){
	origWidth = this._width
}
onClipEvent(enterFrame) {
	if(origWidth>=126) {
		this._xscale-=5;
	}else if (origWidth<=0) {
		delete this.onEnterFrame;
	}
}

```

I’m probably making this more complicated than it should be.  
Oh, and ‘126’ is the actual width of the clip in the properties inspector.  
Thanks
