PDA

View Full Version : [FMX] Showing actions equal timestamp



chipdouglas
July 20th, 2003, 07:28 AM
Hi again!
I've combined some AS. I need to make a external file with data wich loads the data into flash.

The data in the file would look like:

&Game=Denmark-France&Goals=5-0&scoredby=Steve johnson, joe jensen, Dave Watson etc. and each goal would have a
timestamp.

1.My problem is how to make the external data so that it make sense.
2. Load the data into flash
3.Making some kind of loop that tjecks the timestamps from the external file and outputs the player, the game and the player who scored the goal when internal clock is equal to external timestamp.

------here's the code i've "made" --------------------------------

stop();
timefactor = 2 //8 sec pr sec wich means 8 times faster than realtime
trackRemain = 5400; //60sek * 90min (90 min is the total time of a game)
actiontimestamp = 5392; //the time where a action takes place
function timercountdown(){
MinuteRemain = int(trackRemain/60);
SecondRemain = ((trackRemain) - (MinuteRemain*60));
if (length(MinuteRemain) == 1) {
MinuteRemain = "0"+MinuteRemain;
}
if (length(SecondRemain) == 1) {
SecondRemain = "0"+SecondRemain;
}
AutoDisplay = MinuteRemain + ":" + SecondRemain;
if (trackRemain == "0") {
trackRemain = 0;
autoDisplay = "00:00";
gotoAndPlay("end");
}
trackRemain = trackRemain - 1 * timefactor; //multiplying the timefactor with realtime
if (trackRemain == actiontimestamp) {

//load new timestamp
gotoAndPlay("2"); //play action
}
}
setInterval(timercountdown, 1000);

------------------------------------------------------------------------