Lettering Explosion

No need to have anything in the library.

:wink:

Preview:
[COLOR=β€œRed”]http://megaswf.com/view/20304e8c59eb6012ecbc6954d42469da.html[/COLOR]

import mx.transitions.Tween;
import mx.transitions.easing.*;

var objMatrix:Object = {
						k:[
						   [1,0,1],
						   [1,0,1],
						   [1,1,0],
						   [1,0,1],
						   [1,0,1]
						  ],
						i:[
						   [1,1,1],
						   [0,1,0],
						   [0,1,0],
						   [0,1,0],
						   [1,1,1]
						  ],
						r:[
						   [1,1,1],
						   [1,0,1],
						   [1,1,0],
						   [1,0,1],
						   [1,0,1]
						  ],
						u:[
						   [1,0,1],
						   [1,0,1],
						   [1,0,1],
						   [1,0,1],
						   [1,1,1]
						  ],
						p:[
						   [1,1,1],
						   [1,0,1],
						   [1,1,1],
						   [1,0,0],
						   [1,0,0]
						  ],
						a:[
						   [1,1,1],
						   [1,0,1],
						   [1,1,1],
						   [1,0,1],
						   [1,0,1]
						  ],
						f:[
						   [1,1,1],
						   [1,0,0],
						   [1,1,1],
						   [1,0,0],
						   [1,0,0]
						  ],
						x:[
						   [1,0,1],
						   [1,0,1],
						   [0,1,0],
						   [1,0,1],
						   [1,0,1]
						  ],
						e:[
						   [1,1,1],
						   [1,0,0],
						   [1,1,1],
						   [1,0,0],
						   [1,1,1]
						  ],
						s:[
						   [1,1,1],
						   [1,0,0],
						   [1,1,1],
						   [0,0,1],
						   [1,1,1]
						  ],
						o:[
						   [1,1,1],
						   [1,0,1],
						   [1,0,1],
						   [1,0,1],
						   [1,1,1]
						  ],
						n:[
						   [1,0,1],
						   [1,1,1],
						   [1,0,1],
						   [1,0,1],
						   [1,0,1]
						  ]
						};
objMatrix["0"] = [
				  [0,1,0],
				  [1,0,1],
				  [1,0,1],
				  [1,0,1],
				  [0,1,0]
				 ];
objMatrix["9"] = [
				  [1,1,1],
				  [1,0,1],
				  [1,1,1],
				  [0,0,1],
				  [1,1,0]
				 ];
objMatrix["."] = [
				  [0,0,0],
				  [0,0,0],
				  [0,0,0],
				  [0,0,0],
				  [0,1,0]
				 ];

var bg:MovieClip = createEmptyMovieClip("bg",0);
var grid:MovieClip = createEmptyMovieClip("grid",1);
var objColors:Object = {bg:0xAFAF87,circle:0x333333,word:0xCC3366};
var arrPoints:Array = [];
var strMessage:String = "fxpression.09";
var pointRadius:Number = 4.5;
var charSize:Number = 3;
var space:Number = -.3;
var count:Number = 0;
var time:Number = 4;
var objGridSize:Object = {rows:7,cols:strMessage.length*(charSize+1)+1};

function init():Void{
	drawBg();
	drawCircle();
	drawGrid();
	generateLetters();
	scrambleLetters();
	start();
	setInterval(start,(time*1.25)*1000);
}

function drawBg():Void{
	with(bg){
		beginFill(objColors.bg);
		lineTo(Stage.width,0);
		lineTo(Stage.width,Stage.height);
		lineTo(0,Stage.height);
	}
}

function drawCircle():Void{
	var circle = grid.createEmptyMovieClip("circle", 9876);
	var angle:Number, endx:Number, endy:Number, cx:Number, cy:Number;
	var x:Number = 0, y:Number = 0;
	var temp:Number = Math.tan(22.5 * Math.PI/180);
	circle.beginFill(objColors.circle);
	circle.moveTo(x+pointRadius, y);
	for (angle = 45; angle<=360; angle += 45) {
	   endx = pointRadius * Math.cos(angle * Math.PI/180);
	   endy = pointRadius * Math.sin(angle * Math.PI/180);
	   cx = endx + pointRadius * temp *Math.cos((angle-90)* Math.PI/180);
	   cy = endy + pointRadius * temp *Math.sin((angle-90)* Math.PI/180);
	   circle.curveTo(cx+x, cy+y, endx+x, endy+y);
	}
	circle.endFill();
	circle._visible = false;
}

function drawGrid():Void{
	var point:MovieClip;
	var c:Color;
	var depth:Number;
	var i:Number, j:Number, depth:Number;
	depth = 0;
	for (i=0;i<objGridSize.rows;++i) {
		for (j=0;j<objGridSize.cols;++j) {
			point = grid.circle.duplicateMovieClip("point_"+i+"_"+j,depth++,{_x:(grid.circle._width+space)*j,_y:(grid.circle._height+space)*i});
			c = new Color(point);
			c.setRGB(objColors.circle);
		}
	}
	grid._x = (Stage.width - grid._width)/2;
	grid._y = (Stage.height - grid._height)/2;
}

function generateLetters():Void{
	var char:String;
	var point:MovieClip;
	var char:Array;
	var c:Color;
	var i:Number, j:Number, value:Number;
	for (i=0;i<strMessage.length;++i) {
		char = strMessage.charAt(i);
		arrPoints.push(objMatrix[char]);
	}
	for (i=0;i<objGridSize.cols;++i) {
		for (j=0;j<objGridSize.rows;++j) {
			char = arrPoints*[j];
			point = grid["point_"+(j+1)+"_"+i];
			c = new Color(point);
			if(i%(charSize+1)){
				value = arrPoints[Math.floor(i/(charSize+1))][j][(i%(charSize+1)-1)];
				if(value == 1){
					c.setRGB(objColors.word);
				}
			}
		}
	}
}

function scrambleLetters():Void{
	var point:MovieClip;
	var i:Number, j:Number;
	for (i=0;i<objGridSize.rows;++i) {
		for (j=0;j<objGridSize.cols;++j) {
			point = grid["point_"+i+"_"+j];
			point.xf = point._x;
			point.yf = point._y;
			point.xi = random(Stage.width)-grid._x;
			point.yi = random(Stage.width)-grid._y;
		}
	}
}

function animateLetters():Void{
	var point:MovieClip;
	var i:Number, j:Number;
	for (i=0;i<objGridSize.rows;++i) {
		for (j=0;j<objGridSize.cols;++j) {
			point = grid["point_"+i+"_"+j];
			var tweenX = new Tween(point, "_x", Elastic.easeOut  , count%2 ? point.xf : point.xi, count%2 ? point.xi : point.xf, time, true);
			var tweenY = new Tween(point, "_y", Elastic.easeOut  , count%2 ? point.yf : point.yi, count%2 ? point.yi : point.yf, time, true);
		}
	}
}

function start():Void{
	count++;
	animateLetters();
}

init();