On Friday 06 October 2006 20:32, qnotemedia wrote:
Thanks Tom - very nice stuff. Just goes to show that there's so many
different ways to do the same darn thing. I really need to learn Reg
Exp's!
If you need to extract bits from a sting that has a patten to it, they are
often much faster
On Thursday 05 October 2006 18:40, boy_trike wrote:
just to share, here is what I came up with called from the change event:
In the same spirit, here's an untested regexp:
/(\d){1,2}:(\d){0,2}/
You get hours in result[0] and if result.length 1 you have minutes in
result[1].
Much easier.
Thanks Tom - very nice stuff. Just goes to show that there's so many
different ways to do the same darn thing. I really need to learn Reg
Exp's!
- Chris
--- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED]
wrote:
In the same spirit, here's an untested regexp:
On Wednesday 04 October 2006 20:28, qnotemedia wrote:
if ((setTime.length == 4 setTime.charAt(1) == : int
(setTime.charAt(0)) = 1 int(setTime.charAt(0)) = 9 int
(setTime.charAt(2)) = 5 int(setTime.charAt(3)) = 9)
Is there any reason to use a million and one charAt checks rather than
just to share, here is what I came up with called from the change event: I am
also
restricting the input to numbers, :, AM, PM
private function processTime( event : Event ) : void {
var cbtLength : int = this.text.length;
//
Having the same problem here. IMHO, this is so much easier in CF7
Flash Forms with the mask property (mask=99:99 always forces four
numbers with a colon in the middle), and I'm not sure why it has to
be as complicated as it is in Flex2.
The closest I've gotten is by using a number validator
Well - just spent some time with this. Here's what I came up with.
Sloppy, but it works. This allows standard times (1:00, 12:00,
12:59), but not military time (24:00, 13:59, etc.).
private function validateTime():void {
var setTime:String = new String;
setTime =
7 matches
Mail list logo