# Can someone please tell me why

**URL:** <https://forum.kirupa.com/t/can-someone-please-tell-me-why/130812>\
**Category:** Uncategorized\
**Created:** [December 8, 2004, 8:11pm UTC](https://forum.kirupa.com/t/can-someone-please-tell-me-why/130812 "2004-12-08T20:11:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragonfly](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dragonfly](https://forum.kirupa.com/u/dragonfly)\
**Post date:** [December 8, 2004, 8:11pm UTC](https://forum.kirupa.com/t/can-someone-please-tell-me-why/130812/1 "2004-12-08T20:11:22Z")

</div>

why isn’t the alpha de-incrementing/incrementing in integers with this prototype even when i send it an integer for the argument vel? In the following example shouldn’t it be de-incrementing/incrementing by 5s?

```auto
MovieClip.prototype.alpha = function(vel, to) {
	this.vel = vel;
	this.to = to;
	this.alpha_init = this._alpha;
	this.onEnterFrame = function() {
		updateAfterEvent();
		if (this.to != undefined && this.vel != undefined) {
			if (this.to>this.alpha_init) {
				if (this._alpha<=100) {
					this._alpha += this.vel;
				} else {
					this.onEnterFrame = null;
				}
			} else {
				if (this._alpha>this.to) {
					this._alpha -= this.vel;
					trace("this._alpha is: "+this._alpha);
					trace("this.vel is: "+this.vel);
				} else {
					this.onEnterFrame = null;
				}
			}
		} else {
		}
	};
};
box_mc.onPress = function() {
	this.alpha(5, 0);
};

```
