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 x;
public var y;
public function letter(_arg1:Number, _arg2:Number, _arg3:String, _arg4:String, _arg5:Number, _arg6:Number){
labelText = new TextField();
super();
this.offsety = _arg1;
this.multiplier = _arg2;
this.string = _arg3;
this.x = (-40 + _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=\"#" + _arg4) + "\">") + _arg3) + "</font>");
}
public function remove(){
labelText = null;
}
public function update(){
this.x = (this.x + 2);
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 messagesBox:TextField;
public var sendButton:SimpleButton;
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 updateTick(_arg1){
letters.forEach(updateniggers);
if (letters.length > 0){
if (letters[0].x >= 1000){
removeChild(letters[0].labelText);
letters[0].remove();
letters.shift();
};
};
}
public function mouseClicked(_arg1){
toggleDarkener();
}
public function newMessage(_arg1){
var _local2:* = (Math.random() * 0xFFFFFF).toString(16);
var _local3:* = (Math.random() * 100);
var _local4:* = ((1 + (Math.random() * 3)) * 5);
var _local5:* = Math.random();
var _local6:* = 0;
while (_local6 <= _arg1.data.length) {
letters.push(new letter(_local3, _local4, ("" + _arg1.data.charAt((_arg1.data.length - _local6))), _local2, _local5, (_local6 * -18)));
addChild(letters[(letters.length - 1)].labelText);
_local6++;
};
setChildIndex(overlay, (numChildren - 1));
setChildIndex(underButton, (numChildren - 1));
setChildIndex(darkener, (numChildren - 1));
setChildIndex(messagesBox, (numChildren - 1));
setChildIndex(sendButton, (numChildren - 1));
}
public function updateniggers(_arg1, _arg2:int, _arg3:Array):void{
_arg1.update();
}
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(){
port = 1234;
address = "unknownax.is-a-geek.com";
xmlSock = new XMLSocket();
letters = new Array();
counter = 0;
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 sendClicked(_arg1){
xmlSock.send((messagesBox.text + "\n"));
messagesBox.text = "";
toggleDarkener();
}
}
}//package toy_fla