Section 1
//letter (toy.letter)
package toy {
import flash.text.*;
public class letter {
public var multiplier;
public var color;
public var offsety;
public var cos;
public var labelText;
public var string;
public var colorRage;// = false
public var x;
public var y;
public var reversed;// = false
public var lines;// = false
public function letter(_arg1:Number, _arg2:Number, _arg3:String, _arg4:String, _arg5:Number, _arg6:Number, _arg7, _arg8, _arg9){
labelText = new TextField();
super();
this.reversed = _arg7;
this.lines = _arg9;
this.colorRage = _arg8;
this.offsety = _arg1;
this.multiplier = _arg2;
this.string = _arg3;
if (reversed){
this.x = (-40 + _arg6);
} else {
this.x = (1050 - _arg6);
};
this.color = _arg4;
if (_arg5 < 0.5){
cos = true;
} else {
cos = false;
};
labelText = new TextField();
labelText.selectable = false;
labelText.x = this.x;
labelText.htmlText = (((("<font size=\"20\" color=\"#" + color) + "\">") + string) + "</font>");
}
public function remove(){
labelText = null;
}
public function update(){
if (reversed){
this.x = (this.x + 2);
} else {
this.x = (this.x - 2);
};
if (colorRage){
color = (Math.random() * 0xFFFFFF).toString(16);
labelText.htmlText = (((("<font size=\"20\" color=\"#" + color) + "\">") + string) + "</font>");
};
labelText.x = this.x;
if (cos){
this.y = (Math.cos(((this.x * Math.PI) / 180)) * multiplier);
} else {
this.y = (Math.sin(((this.x * Math.PI) / 180)) * multiplier);
};
this.y = (this.y + offsety);
labelText.y = this.y;
}
}
}//package toy
Section 2
//MainTimeline (toy_fla.MainTimeline)
package toy_fla {
import toy.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.events.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var port;
public var timer;
public var counter;
public var darkener:SimpleButton;
public var letters:Array;
public var overlay:SimpleButton;
public var canvas:MovieClip;
public var sendButton:SimpleButton;
public var messagesBox:TextField;
public var underButton:SimpleButton;
public var address;
public var xmlSock;
public var updateTimer;
public function MainTimeline(){
addFrameScript(0, frame1);
}
public function toggleDarkener(){
darkener.visible = !(darkener.visible);
messagesBox.visible = !(messagesBox.visible);
sendButton.visible = !(sendButton.visible);
}
public function sendClicked(_arg1){
xmlSock.send((messagesBox.text + "\n"));
messagesBox.text = "";
toggleDarkener();
}
public function newMessage(_arg1){
var _local2:* = (Math.random() * 0xFFFFFF).toString(16);
var _local3:* = (Math.random() * 375);
var _local4:* = ((1 + (Math.random() * 3)) * 5);
var _local5:* = Math.random();
var _local6:* = false;
var _local7:* = false;
var _local8:* = false;
var _local9:* = true;
var _local10:* = 0;
while (_local9) {
trace(((("charAt(" + _local10.toString()) + ") == ") + _arg1.data.charAt(_local10)));
_local9 = false;
if ((((_arg1.data.charAt(_local10) == "!")) && (!(_local7)))){
trace("colorRage on");
_local9 = true;
_local7 = true;
_arg1.data = _arg1.data.slice(1, _arg1.data.length);
} else {
if ((((_arg1.data.charAt(_local10) == "#")) && (!(_local6)))){
trace("reverse on");
_local9 = true;
_local6 = true;
_arg1.data = _arg1.data.slice(1, _arg1.data.length);
} else {
if ((((_arg1.data.charAt(_local10) == "@")) && (!(_local8)))){
trace("lines on");
_local9 = true;
_local8 = true;
_arg1.data = _arg1.data.slice(1, _arg1.data.length);
};
};
};
};
var _local11:* = 0;
while (_local11 <= _arg1.data.length) {
if (_local6){
letters.push(new letter(_local3, _local4, ("" + _arg1.data.charAt((_arg1.data.length - _local11))), _local2, _local5, (_local11 * -18), _local6, _local7, _local8));
} else {
letters.push(new letter(_local3, _local4, ("" + _arg1.data.charAt(_local11)), _local2, _local5, (_local11 * -18), _local6, _local7, _local8));
};
addChild(letters[(letters.length - 1)].labelText);
_local11++;
};
setChildIndex(overlay, (numChildren - 1));
setChildIndex(underButton, (numChildren - 1));
setChildIndex(darkener, (numChildren - 1));
setChildIndex(messagesBox, (numChildren - 1));
setChildIndex(sendButton, (numChildren - 1));
setChildIndex(canvas, 0);
}
public function mouseClicked(_arg1){
toggleDarkener();
}
public function updateniggers(_arg1, _arg2:int, _arg3:Array):void{
_arg1.update();
if (((((!((_arg1.string == " "))) && (!((_arg1.string == ""))))) && (_arg1.lines))){
drawLine((_arg1.x + 5), (_arg1.y + 14), (_arg1.x + 5), 0, 0x3B3B3B);
};
}
public function updateTick(_arg1){
canvas.graphics.clear();
letters.forEach(updateniggers);
if (letters.length > 0){
if (letters[0].reversed == false){
if (letters[0].x <= -40){
removeChild(letters[0].labelText);
letters[0].remove();
letters.shift();
};
} else {
if (letters[0].x >= 1030){
removeChild(letters[0].labelText);
letters[0].remove();
letters.shift();
};
};
};
}
public function xmlEvents(_arg1){
switch (_arg1.type){
case "ioError":
break;
case "close":
break;
case "securityError":
break;
};
}
public function reconnect(_arg1){
if (!xmlSock.connected){
xmlSock.connect(address, port);
};
}
function frame1(){
overlay.visible = false;
port = 1234;
address = "unknownax.is-a-geek.com";
xmlSock = new XMLSocket();
letters = new Array();
counter = 0;
canvas = new MovieClip();
canvas.graphics.beginFill(0);
canvas.graphics.drawRect(0, 0, 990, 125);
canvas.graphics.endFill();
canvas.x = 0;
canvas.y = 0;
addChild(canvas);
timer = new Timer(1000);
timer.reset();
timer.start();
timer.addEventListener("timer", reconnect);
updateTimer = new Timer(41);
updateTimer.reset();
updateTimer.addEventListener("timer", updateTick);
updateTimer.start();
darkener.visible = false;
messagesBox.visible = false;
sendButton.visible = false;
messagesBox.backgroundColor = 0x232323;
messagesBox.borderColor = 0xFFFFFF;
sendButton.addEventListener(MouseEvent.CLICK, sendClicked);
underButton.addEventListener(MouseEvent.CLICK, mouseClicked);
darkener.addEventListener(MouseEvent.CLICK, mouseClicked);
xmlSock.addEventListener(IOErrorEvent.IO_ERROR, xmlEvents);
xmlSock.addEventListener(Event.CLOSE, xmlEvents);
xmlSock.addEventListener(DataEvent.DATA, newMessage);
xmlSock.connect(address, port);
}
public function drawLine(_arg1, _arg2, _arg3, _arg4, _arg5){
canvas.graphics.lineStyle(0.25, _arg5, 1, true);
canvas.graphics.moveTo(_arg1, _arg2);
canvas.graphics.lineTo(_arg3, _arg4);
}
}
}//package toy_fla