You'll have to make the date formatter know that the minute is 0.
Something like this
ti.text=dateFormatter.format(new Date(nowCurr.setMinutes(event.target.value)));
 
Hope this helps,
-sam

 
On 8/29/06, Bruce Denham <[EMAIL PROTECTED]> wrote:

I'm trying to use to make a numericstepper control display two zeroes
(00) instead of the single zero (0). I think the reason my current
attempts using a DateFormatter are failing is because I'm trying to
format a number as a string using formatString="NN", and the numeric
stepper is just ignoring it, I guess. But I looked at the
NumberFormatter, and didn't see anything useful other than precision
(which is the wrong side of the decimal for my needs).

Here's the code I'm trying to use:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" width="400"
height="300" initialize="Format();">

<mx:Script>
<![CDATA[
import mx.events.NumericStepperEvent;
import mx.controls.Alert ;
import mx.formatters.*;
public function timeChange(event:NumericStepperEvent):void
{
if(event.target.id=="minutes")
{
if(event.target.value==60)
{
event.target.value=0;
dateFormatter.format (event.target.value);
}
}
}

private function Format():void
{
dateFormatter.format(minutes.value);
Alert.show(minutes.value.toString());
}

]]>
</mx:Script>
<mx:DateFormatter id="dateFormatter" formatString="NN" />
<mx:NumberFormatter id="numFormatter" rounding="none" />
<mx:NumericStepper id="minutes" height="20" value="0" stepSize="15"
maximum="60"
change="timeChange(event);" borderThickness="0" y="118" left="195"
right="78" width="60"/>
</mx:Application>

Any help would be greatly appreciated.

Best,
Bruce


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to