This is for a clock display- I've got a dropdown populated by an xml file that has a date/time offset for various locations (var = myLoc).
I also have a function that uses the myLoc value passed from the dropdown. This function cycles every 60 seconds to call another function and get some other data. I would like it to keep using the original value of myLoc until the user selects something else from the dropdown but it keeps resetting the myLoc value to null.
Any ideas?
this.onEnterFrame = function():Void {
yourDate = new Date();
yourHours = yourDate.getHours();
yourMins = Number(yourDate.getMinutes());
yourSecs = Number(yourDate.getSeconds()) ;
yourMilliSecs = Number(yourDate.getMilliseconds()) ;
if (yourMins<10){yourMins = "0" + String(yourMins);};
if (yourSecs<10){yourSecs = "0" + String(yourSecs);};
// Cycle every 60 seconds
if (yourSecs==0 && yourMilliSecs<90){
loadWCLocData(myLoc);
}
// LOCAL Time display
localTimeBox.htmltext = yourHours + ":" + yourMins + ":" + yourSecs ;
// DESTINATION Time display
destTimeBox.htmltext = dspSelLocHour+ ":" + dspSelLocMin + ":" +yourSecs ;
};
I also have a function that uses the myLoc value passed from the dropdown. This function cycles every 60 seconds to call another function and get some other data. I would like it to keep using the original value of myLoc until the user selects something else from the dropdown but it keeps resetting the myLoc value to null.
Any ideas?
this.onEnterFrame = function():Void {
yourDate = new Date();
yourHours = yourDate.getHours();
yourMins = Number(yourDate.getMinutes());
yourSecs = Number(yourDate.getSeconds()) ;
yourMilliSecs = Number(yourDate.getMilliseconds()) ;
if (yourMins<10){yourMins = "0" + String(yourMins);};
if (yourSecs<10){yourSecs = "0" + String(yourSecs);};
// Cycle every 60 seconds
if (yourSecs==0 && yourMilliSecs<90){
loadWCLocData(myLoc);
}
// LOCAL Time display
localTimeBox.htmltext = yourHours + ":" + yourMins + ":" + yourSecs ;
// DESTINATION Time display
destTimeBox.htmltext = dspSelLocHour+ ":" + dspSelLocMin + ":" +yourSecs ;
};