salve a tutti,
premetto che non son un mago dell AS, ma me la sto cavicchiando.


Sto creando un filmato che fa vedere un conto alla rovescia da una data prestabilita.
Ho trovato online un AS che mi è stato utile:
eccolo:


Date.prototype.countdate = function(anfang, ziel)
{
var differenz = ziel-anfang;

// Berechnung
var ms = differenz;
var sek = Math.floor(ms/1000);
ms %= 1000;
var min = Math.floor(sek/60);
sek %= 60;
var std = Math.floor(min/60);
min %= 60;
var tage = Math.floor(std/24);
std %= 24;
var jahre = Math.floor(tage/365);
tage %=365;

// Daten
this["differenz"] = differenz;
this[0] = differenz;
this["jahre"] = jahre;
this[1] = jahre;
this["tage"] = tage;
this[2] = tage;
this["stds"] = std;
this[3] = std;
this["minutes"] = min;
this[4] = min;
this["sekonds"] = sek;
this[5] = sek;
this["millis"] = ms;
this[6] = ms;
return this;
};
ASSetPropFlags(Date.prototype, "countdate", 1, true);

function digitCheck(wert,exponent)
{
return (wert < Math.pow(10,exponent)) ? wert = "0" + wert : wert;
}


function initcount() {
jahr = 2008;
monat = 04;
tag = 13;
}

function countausgeben()
{
ausgabe_txt.text = "";

// Anfang und Zieldatum
var heute = new Date();
var ziel = new Date(jahr, (monat-1), tag, 0, 0, 0);

// Aufruf der countdate-Methode (Datumsberechnung)
neujahr = new Date().countdate(heute, ziel);

// Ausgabe der Datumsberechnung
ausgabe_txt.text +=
"-" + digitCheck(neujahr["tage"],1) + "gg\n" +
digitCheck(neujahr["stds"],1) + "h" +
+ digitCheck(neujahr["minutes"],1) + "'"
+ digitCheck(neujahr["sekonds"],1) + "''";
}


initcount();


this.onEnterFrame = function()
{
countausgeben();
}



La questione è questa.
Dovrei aggiustare la data in maniera carina, in modo tale che il numero dei giorni sia più grande rispetto alle ore minuiti e secondi.
insomma vorrei gestire la formattazione tramite AS degli elementi.
Secondo voi con quest AS è possibile? e come?
Eventualmente ci sono altre soluzioni?

Vi ringrazio in anticipo
Felix