# Xscale problem

**URL:** https://forum.kirupa.com/t/xscale-problem/65957
**Category:** Uncategorized
**Created:** [September 30, 2004, 10:22pm UTC](https://forum.kirupa.com/t/xscale-problem/65957 "2004-09-30T22:22:43Z")
**Posts on this page:** 3
**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/65957/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

---

<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 30, 2004, 11:10pm UTC](https://forum.kirupa.com/t/xscale-problem/65957/2 "2004-09-30T23:10:44Z")

</div>

How about:

onClipEvent(enterFrame) {  
if (this.\_xscale\>0) {  
this.\_xscale-=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: [September 30, 2004, 11:38pm UTC](https://forum.kirupa.com/t/xscale-problem/65957/3 "2004-09-30T23:38:28Z")

</div>

> I’m probably making this more complicated than it should be.

:lol:  
thanks mate, that’s it.
