Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
nrutter #1
Adding hours to Flex timer
I am attempting to add hours to my Flex timer and it is not working? The hour
column starts at 18....Any ideas
private const HOUR_MASK:String = "00";
private const MIN_MASK:String = "00";
private const SEC_MASK:String = "00";
private const MS_MASK:String = "000";
private const TIMER_INTERVAL:int = 10;
private var baseTimer:int;
private var t:Timer;
private function init():void{
t = new Timer(TIMER_INTERVAL);
t.addEventListener(TimerEvent.TIMER, updateTimer);
baseTimer = getTimer();
t.start();
}
private function updateTimer(evt:TimerEvent):void {
var d:Date = new Date(getTimer() - baseTimer);
var hour:String = (HOUR_MASK + d.hours).substr(-HOUR_MASK.length);
var min:String = (MIN_MASK + d.minutes).substr(-MIN_MASK.length);
var sec:String = (SEC_MASK + d.seconds).substr(-SEC_MASK.length);
var ms:String = (MS_MASK + d.milliseconds).substr(-MS_MASK.length);
callTime.text = String(hour + ":" + min + ":" + sec);
}
<mx:TextInput id="callTime" fontSize="10" editable="true" width="82"
height="19"/>
nrutter Guest
-
Dynamically Adding Vertical Axis to Flex Charts
Hello, I have an application that enables the users to dynamically select what series their chart is displaying. Users often want to plot multiple... -
Flex 2.0 Dynamically adding columns to a DataGrid (worked in 1.5)
I have code that works fine in v1.5 to add columns to a mx.controls.DataGrid but there is no method addColumn() in 2.0 Any help on this would be... -
Could I use flash.util.* Timer and interval in Flex 1.5
Could I use import flash.util.* Timer and interval in Flex 1.5. ???? Is there any sample code for timely refresh the table data? Thanks for... -
adding hours to a dateTime object
I have a datetime object (now()) and timedifference via getTimeZone() - eg "5" hours. Now I want to hava new dateTime object that differs from now()... -
System.Timers.Timer vs. System.Threading.Timer
Hi Just a quick question... When would you use System.Timers.Timer, and when System.Threading.Timer? What are the principal differences... -
-
ntsiii #3
Re: Adding hours to Flex timer
I do not see anything wrong. You will just need to debug this.
I don't really understand the problem either. Is there no data for hours or
the wrong data?
does d.hours return a value?
trace(hour); //what doe it display?
Tracy
ntsiii Guest
-
vaig #4
Re: Adding hours to Flex timer
var ms:Number = getTimer() - baseTimer
var d:Date = new Date(0, 0, 0, 0, 0, 0, ms);
var hrs:String = (HRS_MASK + d.hours).substr(-HRS_MASK.length);vaig Guest



Reply With Quote

