Flash Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignFlash Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 20th, 2007, 12:49 PM
pcooke pcooke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 pcooke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 2 sec
Reputation Power: 0
Flash data format Question from jsp developer

I am on my first flash program, and now loosing what little hair I have left.

Until recently our flash front end would tell us that a date was not of mm/dd/yyyy format. Now our flash front end is accepting 12/12/1 and zero filling the year to be 0001.

Could someone kindly point me in the right direction to force the date fields to require all 8 digits plus the slashes?


My brain feel like I am trying to modify sendmail.cf files.

Reply With Quote
  #2  
Old May 12th, 2007, 09:40 PM
blitz01 blitz01 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 7 blitz01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 19 m 52 sec
Reputation Power: 0
Quote:
"I am on my first flash program, and now loosing what little hair I have left."

lol - know how ya feel. just keep digging.. just how this stuff is (most of the time)


date = date.text

for starters:

8 + 2 slashes = 10 so you can do:

Code:
if (date.text.length == 10){
	// date length is valid 
           // do some indexOf("/") checks
          // while were at it we might want to check to see if values are numeric
}
else{
// can check if it's too short too long whatever.. or just not valid
}

Code:
you can also use :
If (date.text.indexOf("/") != 3) {
 // missing slash in 3rd spot of string
}

indexOf() returns the character "number" where the value in parentheses is first found in a string. or in this case _ _ / = 3

you can also use lastIndexOf() to return the positon of the 2nd slash ..

you could have all this in a function called

valitateDate(){
//check the date string
// If good submit form
}

your submit button could be
on (release) {
valitateDate();
}

hope this helps..

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignFlash Development > Flash data format Question from jsp developer


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT