errr, i was bored so i decided to mess around and make somethign similar, but not really, to what lostinbeta made with the jumping orbs… what im trying to do is make it so when the mouse gets closer to text it fades in and scales up, and vice versa
[AS]MovieClip.prototype.scaleClip = function() {
//get the effected area, aka the width of the clip
this.area = this._width;
//onMouseMove dynamic event handler
this.onMouseMove = function() {
//time for basic trig
//distance x
this.dx = this._x-_root._xmouse;
//distance y
this.dy = this._y-_root._ymouse;
//hypotenuse between points dx and dy
this.hyp = Math.sqrt(this.dxthis.dx+this.dythis.dy);
//if the hypotenuse width is within the area variable value
if (this.hyp<this.area) {
//this creates the scaling
this.strength = Math.pow((this.area-this.hyp)/this.area, 3);
//scale the clip (15 is minimum scale, 100 is max scale)
this._xscale = this._yscale=this._alpha=15+100*this.strength;
} else {
//else if the hypotenuse is not within the area variable
//set the _xscale, _yscale, and _alpha to 15
this._xscale = this._yscale=this._alpha=15;
}
};
};
f1.scaleClip();
f2.scaleClip();
f3.scaleClip();
f4.scaleClip();[/AS]
instead of typing f1.scaleClip(), f2.scaleClip() etc etc you can use a for loop.
[AS]//create for loop to cycle through the clips
for (var i = 1; i<=50; i++) {
//set a variable that contains the instance name of the clip
clip = this[“f”+i];
//assign the function to the instance
clip.scaleClip();
}[/AS]
LOL, i had a few typos, as well as i dont fully know AS yet, not nearly… and u lost right at… ur first post… but when i learn more AS ill come back to this thread and go… ohhhhhhh…