# 2d array text effect

**URL:** <https://forum.kirupa.com/t/2d-array-text-effect/182748>\
**Category:** open source\
**Created:** [March 21, 2006, 5:12am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748 "2006-03-21T05:12:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nugget](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@nugget](https://forum.kirupa.com/u/nugget)\
**Post date:** [March 21, 2006, 5:12am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/1 "2006-03-21T05:12:23Z")

</div>

A pretty cool text effect i made today with a 2d array, sorry it has to be this way but that is the only way i could accomplish the effect

here is the swf and the fla

to change the text you will have to alter the array and it does take a while.

---

<div class="post-metadata">

**Author:** ![MichaelxxOA](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@MichaelxxOA](https://forum.kirupa.com/u/MichaelxxOA)\
**Post date:** [March 21, 2006, 5:48am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/2 "2006-03-21T05:48:44Z")

</div>

I like that alot!

---

<div class="post-metadata">

**Author:** ![freeskier89](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@freeskier89](https://forum.kirupa.com/u/freeskier89)\
**Post date:** [March 21, 2006, 6:20am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/3 "2006-03-21T06:20:35Z")

</div>

:stare: I absolutely love it! It is amazing how such little code and a glow can produce such a neat effect. Keep up the great work! 😃

---

<div class="post-metadata">

**Author:** ![gonzales](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gonzales](https://forum.kirupa.com/u/gonzales)\
**Post date:** [March 21, 2006, 6:32am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/4 "2006-03-21T06:32:23Z")

</div>

really nice! i like the mouse effect with the blur!

---

<div class="post-metadata">

**Author:** ![28bit](https://avatars.discourse-cdn.com/v4/letter/2/46a35a/32.png) [@28bit](https://forum.kirupa.com/u/28bit)\
**Post date:** [March 21, 2006, 8:19am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/5 "2006-03-21T08:19:31Z")

</div>

Nice one! 🙂

---

<div class="post-metadata">

**Author:** ![grmlyn](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@grmlyn](https://forum.kirupa.com/u/grmlyn)\
**Post date:** [March 21, 2006, 8:28am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/6 "2006-03-21T08:28:53Z")

</div>

really nice

---

<div class="post-metadata">

**Author:** ![Exos\_Sho](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Exos\_Sho](https://forum.kirupa.com/u/Exos_Sho)\
**Post date:** [March 21, 2006, 9:41am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/7 "2006-03-21T09:41:47Z")

</div>

your script is a good basic for some funny things

---

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [March 21, 2006, 3:47pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/8 "2006-03-21T15:47:02Z")

</div>

tileMap\_Ev2.swf (744 Bytes, 13 views)

this sort of reminds me of a water effect, add a light blue layer with a really low alpha and it would look cool

---

<div class="post-metadata">

**Author:** ![rmo518](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@rmo518](https://forum.kirupa.com/u/rmo518)\
**Post date:** [March 21, 2006, 4:24pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/9 "2006-03-21T16:24:12Z")

</div>

Looks great. Any chance you could post the AS for those of us who don’t have Flash 8 yet?

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [March 21, 2006, 4:27pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/10 "2006-03-21T16:27:37Z")

</div>

good work, i like it.

---

<div class="post-metadata">

**Author:** ![nugget](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@nugget](https://forum.kirupa.com/u/nugget)\
**Post date:** [March 21, 2006, 5:48pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/11 "2006-03-21T17:48:05Z")

</div>

thanks for all of the comments

here is the script for those without flash 8 yet:

```auto
_quality = "BEST";
Stage.scaleMode = "noScale";
text_arr = [
   [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1],
   [0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], 
   [0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], 
   [0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0], 
   [0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0]
   ];
maxwidth = text_arr[0].length*11;
maxheight = text_arr.length*11;
for (var i = 0; i<text_arr.length; i++) {
 for (var j = 0; j<text_arr*.length; j++) {
  depth = this.getNextHighestDepth();
  if (text_arr*[j] == 1) {
   this.attachMovie("block", "block"+depth.toString(), depth);
   this["block"+depth]._x = (j*10)+(Stage.width/2-maxwidth/2);
   this["block"+depth]._y = (i*10)+(Stage.height/2-maxheight/2);
  }
  this["block"+depth].onEnterFrame = function() {
   dx = this._x-_root._xmouse;
   dy = this._y-_root._ymouse;
   dist = Math.sqrt(dx*dx+dy*dy);
   if (dist > 100) dist = 100;
   this._xscale = this._yscale += (dist-this._xscale);
  };
 }
}

```

and you need to make your own movieclip with a linkage id of “block” 10 pixels wide and high.

---

<div class="post-metadata">

**Author:** ![vini](https://avatars.discourse-cdn.com/v4/letter/v/c77e96/32.png) [@vini](https://forum.kirupa.com/u/vini)\
**Post date:** [March 22, 2006, 2:40am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/12 "2006-03-22T02:40:59Z")

</div>

Good piece of work I really like the blurr part

Cheers…

–  
Its in my blood to B+

---

<div class="post-metadata">

**Author:** ![cr125rider](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/cr125rider/32/534_2.png) [@cr125rider](https://forum.kirupa.com/u/cr125rider)\
**Post date:** [March 23, 2006, 10:23pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/13 "2006-03-23T22:23:32Z")

</div>

Here is my mod, glass ball effect:

---

<div class="post-metadata">

**Author:** ![cr125rider](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/cr125rider/32/534_2.png) [@cr125rider](https://forum.kirupa.com/u/cr125rider)\
**Post date:** [March 24, 2006, 4:04am UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/14 "2006-03-24T04:04:41Z")

</div>

Here is a compilation I put together, has 8 different effects in it. Press the arrow on the right to go to the next one. Enjoy!

EDIT: Its all in the corner, thats weird! Download it and run it in the standalone and it works fine, sorry about that guys!

---

<div class="post-metadata">

**Author:** ![dimitri\_c](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dimitri\_c](https://forum.kirupa.com/u/dimitri_c)\
**Post date:** [March 24, 2006, 2:22pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/15 "2006-03-24T14:22:36Z")

</div>

CR125rider you rock! 😉

---

<div class="post-metadata">

**Author:** ![nugget](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@nugget](https://forum.kirupa.com/u/nugget)\
**Post date:** [March 24, 2006, 7:42pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/16 "2006-03-24T19:42:24Z")

</div>

those are awsome. I was in the middle of making a tile class that takes an array builds the tiles and then you can call an effect like this:

```auto
 
Stage.scaleMode = "noScale";
text_arr = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1],
    [1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1],
    [1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1],
    [1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1],
    [1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    ];
var k:Number = -1;
maxwidth = text_arr[0].length*11;
maxheight = text_arr.length*11;
var Scene:Tile = new Tile(text_arr,"block",10,_root,true);
Scene.distance();

```

and here is my class so far,

```auto
 
class Tile {
 public var array:Array;
 public var attachMC:String;
 public var tileWidth:Number;
 public var holderMC:MovieClip;
 public var centerS:Boolean;
 public var effect:String;
 function Tile(arr:Array, attach_clip:String, tWidth:Number, holder:MovieClip, center:Boolean) {
  array = arr;
  attachMC = attach_clip;
  tileWidth = tWidth;
  holderMC = holder;
  centerS = center;
  Build();
 }
 public function Build() {
  var maxwidth:Number = array[0].length*tileWidth;
  var maxheight:Number = array.length*tileWidth;
  for (var i = 0; i<array.length; i++) {
   for (var j = 0; j<array*.length; j++) {
    var depth = holderMC.getNextHighestDepth();
    if (array*[j] == 1) {
     holderMC.attachMovie(attachMC, "block"+depth.toString(), depth);
     holderMC["block"+depth]._x = centerS ? (j*tileWidth)+(Stage.width/2-maxwidth/2) : (j*tileWidth);
     holderMC["block"+depth]._y = centerS ? (i*tileWidth)+(Stage.height/2-maxheight/2) : (i*tileWidth);
    }
   }
  }
 }
 public function distance() {
  var k:Number = -1;
  var dx, dy, dist:Number = 0;
  for (var i = 0; i<array.length; i++) {
   for (var j = 0; j<array*.length; j++) {
    k++;
    holderMC["block"+k].onEnterFrame = function() {
     dx = this._x-_root._xmouse;
     dy = this._y-_root._ymouse;
     dist = Math.sqrt(dx*dx+dy*dy);
     if (dist>110) {
      dist = 110;
     }
     this._xscale = this._yscale += (dist-this._xscale);
    };
   }
  }
 }
}

```

i only made one effect so far but was going to do a lot more. Infact i will put your effects in the class and when im done with it, ill post it.

thanks

---

<div class="post-metadata">

**Author:** ![nugget](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@nugget](https://forum.kirupa.com/u/nugget)\
**Post date:** [March 24, 2006, 8:39pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/17 "2006-03-24T20:39:33Z")

</div>

alright here it is. the class file: (Could have much improvement) 🙂  
the fla: self explanitory has comments explaining class

---

<div class="post-metadata">

**Author:** ![cr125rider](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/cr125rider/32/534_2.png) [@cr125rider](https://forum.kirupa.com/u/cr125rider)\
**Post date:** [March 24, 2006, 9:39pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/18 "2006-03-24T21:39:21Z")

</div>

This thing has really developed! The method to create those little blocks makes it so easy. I jsut kept copy/pasting my effects list to make new cool ones, mostly ones I just stumpled on. Thats great that its in a class now!

---

<div class="post-metadata">

**Author:** ![rmo518](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@rmo518](https://forum.kirupa.com/u/rmo518)\
**Post date:** [March 24, 2006, 10:57pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/19 "2006-03-24T22:57:21Z")

</div>

I thought why not make a movie that generates the text\_arr for you. This AS assumes you have “pixel” in your library - a 10 by 10 2 frame mc - frame 1 stop(); white with grey outline, frame 2 stop(); black - and a button on the stage that calls the createArray() function).

You have to be running the FLA in flash, however, because it depends on the trace function to generate the array. (So the swf alone won’t help too much at this point.)

[FONT=Courier New][AS]w = 15;  
h = 5;  
w\_txt.onChanged = createPixels;  
h\_txt.onChanged = createPixels;  
createPixels();  
function createPixels() {  
\_root.createEmptyMovieClip(“eraser”,1);  
\_root.createEmptyMovieClip(“grid”,1);  
k = 0;  
for (j=0; j\<h; j++) {  
for (i=0; i\<w; i++) {  
k++;  
clip = \_root.grid.attachMovie(“pixel”, “pixel”+k, k, {\_x:i_10, \_y:j_10});  
clip.onRelease = function() {  
this.play();  
};  
}  
}  
}  
function createArray() {  
pixelArray = new Array();  
for (i=1; i\<=w_h; i++) {  
if (\_root.grid[“pixel”+i].\_currentframe == 1) {  
pixelArray.push(0);  
} else {  
pixelArray.push(1);  
}  
}  
trace(“text\_arr = [”);  
pixelString = pixelArray.join(", “);  
for (i=0; i\<h; i++) {  
trace(”["+pixelString.substr(i_w_3, (w_3)-2)+"],");  
}  
trace("];");  
}[/AS]  
[/FONT]

---

<div class="post-metadata">

**Author:** ![nugget](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@nugget](https://forum.kirupa.com/u/nugget)\
**Post date:** [March 24, 2006, 11:40pm UTC](https://forum.kirupa.com/t/2d-array-text-effect/182748/20 "2006-03-24T23:40:26Z")

</div>

That is a pretty useful tool, nice, fast and easy to make arrays.  
thanks

[Next page](https://forum.kirupa.com/t/2d-array-text-effect/182748.md?page=2)
