I really like the text effect Pom used in the footer contest, and would like to use the same grid-type method of creating mc letters but with a different effect. i understand how to change the parameters and shapes of the letters, but can’t seem to figure out which piece of code is purely for the explosion effect. :sigh: basically, i want the letters but with the ‘Repel’ effect from
http://downloads.junioronline.us
here is Pom’s AS:
[AS]
cellSize=3;
radius=10;
damp=.85;
dampR=.8;
numLetter=0;
letterSpacing=40;
shift = .5;
letterP=new Array(
[1,1,1,1,1,0],
[1,1,0,0,0,1],
[1,1,0,0,0,1],
[1,1,1,1,1,0],
[1,1,0,0,0,0],
[1,1,0,0,0,0]);
letterO=new Array(
[0,1,1,1,1,0],
[1,1,0,0,0,1],
[1,1,0,0,0,1],
[1,1,0,0,0,1],
[1,1,0,0,0,1],
[0,1,1,1,1,0]);
letterM=new Array(
[1,1,0,0,0,1],
[1,1,1,0,1,1],
[1,1,0,1,0,1],
[1,1,0,0,0,1],
[1,1,0,0,0,1],
[1,1,0,0,0,1]);
function containerRollOVer(){
delete this.onRollOver;
for (var clip in this) this[clip].explode();
}
function displayCell(letter){
var num=1,i,j,mc;
clip=this.createEmptyMovieClip(“container”+numLetter,numLetter++);
clip._x=30+numLetterletterSpacing;
clip._y=20;
clip.createEmptyMovieClip(“cell”,0)._visible = 0;
clip.cell.lineStyle(cellSize,0xcccccc,100);
clip.cell.lineTo(.15,.45);
for (j=0;j<letter.length;j++){
for (i=0;i<letter[0].length;i++){
if (letter[j]==1){
mc=clip.cell.duplicateMovieClip(“cell”+num,num);
mc.i=i;
mc.j=j;
mc._x=i*(cellSize+shift);
mc._y=j*(cellSize+shift);
num++;
}
}
}
clip.cell.removeMovieClip();
this.clip.onRollOver=containerRollOver;
}
MovieClip.prototype.explode=function(){
this.vx=(Math.random()-.5)2radius;
this.vy=(Math.random()-.5)2radius;
this.onEnterFrame=function(){
this.resizeCell();
this._x+=this.vx;
this._y+=this.vy;
this.vx*=damp;
this.vy*=damp;
if (Math.abs(this.vx)+Math.abs(this.vy) < .08)
this.onEnterFrame=spinningAround;
}
}
function spinningAround(){
var diffx=this._x-this.i*(cellSize+shift);
var diffy=this._y-this.j*(cellSize+shift);
this.resizeCell();
this.vx-=diffx/7;
this.vy-=diffy/7;
this.vx*=dampR;
this.vy*=dampR;
this._x+=this.vx;
this._y+=this.vy;
if (Math.abs(this.vx)+Math.abs(this.vy) < .01){
this._x=this.i*(cellSize+shift);
this._y=this.j*(cellSize+shift);
delete this.onEnterFrame;
this._parent.onRollOver=containerRollOver;
}
}
MovieClip.prototype.resizeCell=function(){
var diffx=this._x-this.icellSize;
var diffy=this._y-this.jcellSize;
var dist=diffxdiffx+diffydiffy;
this._xscale=this._yscale=this._alpha=(10000-dist)/100;
// you can try that instead:
// this._xscale=this._yscale=this._alpha=(1000-dist)/10;
}
displayCell(letterP);
displayCell(letterO);
displayCell(letterM);
[/AS]
and here is the .fla using the repel effect using pre-made mc: