Si cum era enervant sa tot dau echo la timestampuri (echo date('d m y', '1247500288') ) ca sa vad care e data cu pricina mi-am facut un mic script in actionscript 3 ca si asa tot ma chinui sa invat de ceva timp

Asa ca.. urmatorul script genereaza campul de input, campul de rezultat si un buton.
Va rog sa imi spuneti ce scriu gresit sau cum ar trebui sa fac refactor la cod sa arate mai bine .. mai scurt.. sau mai eficient.
Si nu in ultimu rand poate mai ajuta si pe altcineva chestia asta

- Cod: Selectaţi tot
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
public class secondsToDate extends Sprite
{
private var isOld:Boolean = false;
private var titleField:TextField = new TextField;
private var inputDate:TextField = new TextField;
private var textField:TextField = new TextField;
private var goButton:Sprite = new Sprite;
private var butonText:TextField = new TextField;
public function secondsToDate()
{
// initiate a stage object and tell it to behave
var swfStage:Stage = this.stage;
swfStage.scaleMode = StageScaleMode.NO_SCALE;
swfStage.align = StageAlign.TOP_LEFT;
// add a title to this shit
titleField.text = 'Linux/Epoch Time (in seconds)';
titleField.width = 390;
titleField.height = 20;
titleField.x = 10;
titleField.y = 10;
addChild(titleField);
// create input text field
inputDate.type = 'input';
inputDate.name = 'inputDate';
inputDate.x = 10;
inputDate.y = 30;
inputDate.width = 200;
inputDate.height = 20;
inputDate.border = true;
inputDate.borderColor = 0xFFCCFF;
addChild(inputDate);
// create a button
goButton.graphics.beginFill(0x00FF00, 1);
goButton.graphics.drawRoundRect(10, 90, 100, 20, 8, 8);
goButton.graphics.endFill();
goButton.mouseChildren = false;
goButton.buttonMode = true;
goButton.useHandCursor = true;
addChild(goButton);
// button title
butonText.text = 'Get Date';
butonText.width = goButton.width;
butonText.height = goButton.height;
butonText.x = 20;
butonText.y = 90;
goButton.addChild(butonText);
// attach some functionality to the button
goButton.addEventListener(MouseEvent.CLICK,
function ():void
{
// get info from input text
var inputSeconds:Date = new Date(Number(inputDate.text) * 1000);
var hours:String = String(inputSeconds.getHours());
var minutes:String = String(inputSeconds.getMinutes());
var day:String = String(inputSeconds.getDate());
var month:String = String(inputSeconds.getMonth()+1);
var year:String = String(inputSeconds.getFullYear());
// show results in a new textfield
if(isOld){ textField.text = ''; } // reset the date field
createTextField(String(hours + ':' + minutes + ' | ' + day + ' / ' + month + ' / ' + year));
});
}
// create the textfield for the result and insert information
private function createTextField( resultValue:String ):void
{
isOld = true;
textField.autoSize = flash.text.TextFieldAutoSize.LEFT;
textField.height = 20;
textField.x = 10;
textField.y = 60;
textField.background = true;
textField.backgroundColor = 0xCCCCCC;
textField.text = resultValue;
addChild(textField);
}
}
}