Ciao a tutti,
io ho un file data, dove scrivo una data che varia di settimana in settimana, completa di anno mese giorno ore e minuti, cosi riportata su file txt chiamato data.txt
&anno=2010
&mese=04
&giorno=08
&ora=15
&minuti=00

ora in flash ho creato un countdown...tale countdown deve prendere i dati dal file data.txt e darmi iltempo rimanente a tale dato sul mio file txt...

come faccio?


codice 1° frame flash, su lsecondo c'è stop
stop();
Stage.showMenu = false;
_quality = "BEST"

loadVariablesNum("data.txt", 0);

// Questa parte di codice serve se si vuole un countdownd con variabili interne
var anno=anno;
var mese=mes;
var giorno=giorno;
var ora=ora;
var minuti=minuti;
//
currentDate = new Date();
thisYear = currentDate.getFullYear();
scadenza.text = "Scadenza: "+_root.minuti+"/"+_root.ora+"/"+_root.giorno+"/"+_root.mese;+"/"+_root.anno;;
eventDate = new Date(_root.anno, _root.mese-1, _root.giorno, _root.ora, _root.minuti);
eventMillisecs = eventDate.getTime();
counter.onEnterFrame = function() {
currentDate = new Date();
}
trace(this.hours);
this.secs = Math.floor(this.msecs/1000);
this.mins = Math.floor(this.secs/60);
this.hours = Math.floor(this.mins/60);
this.days = Math.floor(this.hours/24);
this.msecs = String(this.msecs%1000);
this.secs = String(this.secs%60);
this.mins = String(this.mins%60);
this.hours = String(this.hours%24);
this.days = String(this.days);
while (this.secs.length<2) {
this.secs = "0"+this.secs;
}
if (this.mins.length<2) {
this.mins = "0"+this.mins;
}
if (this.hours.length<2) {
this.hours = "0"+this.hours;
}
while (this.days.length<3) {
this.days = "0"+this.days;
}
for (movie in this) {
if (this[movie]._parent == this) {
this[movie].evaluateFrameFrom(this);
}
}
;
MovieClip.prototype.evaluateFrameFrom = function(variableClip) {
var nameArray = this._name.split("_");
var numberSet = variableClip[nameArray[0]];
var character = Number(nameArray[1]);
var frame = 1+Number(numberSet.charAt(character));
if (this._currentframe != frame) {
this.gotoAndStop(frame);
}
};