# Array AS in Pom's footer

**URL:** https://forum.kirupa.com/t/array-as-in-poms-footer/91066
**Category:** Uncategorized
**Created:** [June 16, 2003, 2:25pm UTC](https://forum.kirupa.com/t/array-as-in-poms-footer/91066 "2003-06-16T14:25:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![imported\_no\_bone\_mov](https://avatars.discourse-cdn.com/v4/letter/i/c37758/32.png) [@imported\_no\_bone\_mov](https://forum.kirupa.com/u/imported_no_bone_mov)
#### Post date: [June 16, 2003, 2:25pm UTC](https://forum.kirupa.com/t/array-as-in-poms-footer/91066/1 "2003-06-16T14:25:56Z")

</div>

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](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+numLetter_letterSpacing;  
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)_2_radius;  
this.vy=(Math.random()-.5)_2_radius;  
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.i_cellSize;  
var diffy=this.\_y-this.j_cellSize;  
var dist=diffx_diffx+diffy_diffy;  
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:
