Solved

form checking input email and number values in flash

Posted on 2006-07-14
2
183 Views
Last Modified: 2010-04-03
Hi experts,

As title I would like to know how to check in flash:

1) a text field 'phone' is number or not
2) a text field 'email' has the correct email format or not (with the @ and '.')

Thanks~!
0
Comment
Question by:huang_ck
2 Comments
 
LVL 7

Accepted Solution

by:
furmiga earned 500 total points
ID: 17113367
Hi there!


Answering n.1 - If you want just numbers in your phone text field then just select the range of the characters allowed to be typed in the field. (In the imput text properties, you will find a button named "characters...", hit "Specify Ranges" and then click "Numerals[0..9]..." then hit OK.

Answering n.2 - This is a bit more complicated. You can set any verifications but still you can't prevent from a wrong imput.

on(release) // simple button action
{
    if((email.text.indexOf("@") == -1) or (email.text.charAt(0) == ".") or (email.text.charAt(0) == "@") or (email.text.indexOf(".") == -1))
    {
        trace("Wrong email format.")
    }
}

Here the email field can't start with "." or with"@" and must have both along the string. This is enuf to make you imput an correct email format. Again, this won't prevent users from type "damn_email@verification.com" with im pretty sure doesn't exist :)

Thats it. Anything just gimme a call


Ralph
0
 

Author Comment

by:huang_ck
ID: 17123081
cool thanks~!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IE 11 Flash Player issue 7 238
Action Script commands 4 314
Failed download 57 563
Begin mp4 video on first frame 6 171
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question