P
ROTOTYPE
I'm Not Only The Prototype, I'm Also A Member.
home
▪
stats
▪
search
▪
linkback
▪
about
▪
FAQ
| user: guest,
login
,
register
Movieclip
:
changePropTo with onOverChangeProp =) ver 1.3
author:
kk
[+]
,
Submitted: 03.19.05 7a
• Last Edit: 03.19.05 7a
////////////////////////////////// // .grin! wuz here // ////////////////////////////////// // 1.3: // // changes: added acceleration // ////////////////////////////////// MovieClip.prototype.changePropTo = function(prop, final, step, speedUp){ var doIf = (this[prop] != final) && (typeof this[prop] == typeof final); if(doIf){ if(!speedUp) speedUp = 0; var rel = this[prop]<final; var n = "$$chProp$$"+prop; var inc = (final - this[prop])/Math.abs(this[prop] - final); step = inc*Math.abs(step); this.createEmptyMovieClip(n, this.getNextHighestDepth()); this[n].onEnterFrame = function (){ step += speedUp; this = this._parent; if((this[prop]<final) == rel){ this[prop] += step; } else { this[prop] = final; this[n].removeMovieClip() this.onOverChangeProp(prop, final) } } } }
usage
mc.onOverChangeProp = function(prop, val){ trace("Property "+mc+"."+prop+" is now "+val+"."); } mc._y = mc._x = 0; mc.changePropTo("_y", 300, 1, 1.5); mc.changePropTo("_x", 300, 15);
Add Comment
[+]
›opyleft 2001-2013. Layer51 is: Jaime Prado.
@
buy wow gold
abendkleider online
cocktail dresses uk
woolrich outlet
clarisonic pro
long prom dresses