I’m trying to write a script which gets the current time and then checks through a bus schedule and lets the user know when the next 2 or 3 buses are scheduled. I thought I could put the bus schedule into an array and compare the current time with the time values in the array, but I can only access the array by the index numbers, not by the actual time values. Is there a way to get at those time values directly?
To simplify things I’m initially working with an array of ten consecutive numbers (1 to 10) to represent the bus times and then trying to get the 3 numbers after 5. I’ve got 3 fat books on Actionscript and can’t find any reference to this, so perhaps it can’t be done in this way. I’d appreciate any thoughts on this.
The above code did work exactly as I wanted but I’ve run into a further problem. To compared the bus schedule times in the array against the current time both need to be converted to numbers (12:30 to 12.5 for example). Then they must be converted back to be shown to the user as times. That’s do-able but klunky and I end up with slightly inaccurate times.
Is it possible to put the actual bus times (12:20, 12:30, 1:00, 1:10, 1:30 etc.) in one array and the decimal times (12.333, 12.5, 1.0, 1.1666, 1.5) into a second array, pick out the 3 buses after the current time (the original problem) and then cross refrence the index numbers of those three buses to the corresponding index numbers in the time array?
Thanks very much for your help on this again. I don’t thoroughly understand what all is happening here, but I’m going to play with it over the weekend and see if I can get it to work and understand it.
Thanks for taking time to help. I am grateful for your expertise.
Cheers,
Cliff
Now that I can retrieve the values of the next buses on the 24 hour clock I want to convert them to a 12 hour clock. I’ve been trying to adapt the “Array.prototype.getNextBuses” function (above) to work along with a very simple function:
if (hour> 12 ) {
hour = hour -12;
is the prototype function adaptable to this purpose?
did u guys know how to load more than 1 .swf file tp stage ,but is after one swf file finish automatically load another swf file , and the 2 file is click(choose)by the user itself through buttons.