2d array text effect

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.

I like that alot!

: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! :smiley:

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

Nice one! :slight_smile:

really nice

your script is a good basic for some funny things

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

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

good work, i like it.

thanks for all of the comments

here is the script for those without flash 8 yet:

_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.

Good piece of work I really like the blurr part

Cheers…


Its in my blood to B+

Here is my mod, glass ball effect:

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!

CR125rider you rock! :wink:

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:

 
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,

 
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

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

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!

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:i10, _y:j10});
clip.onRelease = function() {
this.play();
};
}
}
}
function createArray() {
pixelArray = new Array();
for (i=1; i<=wh; 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
w3, (w3)-2)+"],");
}
trace("];");
}[/AS]
[/FONT]

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