ActionScript 3.0 Flash CS5
I am trying to create a standard production of visual basic system, on Flash CS5. It’s an interactive system made in Flash, but the house style is as of Visual Basic. I have almost completed the project however I am finding it difficult to:-
a) If the user types into textboxes in one stage on flash, it should appear down on another screen on another textbox, simultaneously.
b) How to validate textboxes in flash so that the user can only type in certain characters, for example the user would fill in the textboxes when asked about coding in visual basic. At the end of the screen by clicking next it would check the textboxes and if the characters are incorrect it would display an error message, and if correct proceed to the next screen.
This coding is the closes't i got to solving my problem about validation, I have also read a number of ActionScript books but no luck there. I have also searched the net but could not find what i am looking for, all i got was validating using passwords from parameters.
var str:String = "1234";
var n:Number = Number(str);
if (isNaN(n))
{
trace(str + " is not a number");
}
else
{
trace(str + " is a number");
}
str = "12a4";
n = Number(str);
if (isNaN(n))
{
开发者_开发技巧trace(str + " is not a number");
}
else
{
trace(str + " is a number");
}
Thankyou
1) I think its because you probably duplicated the movieclip so maybe thats why its appearing on 2 text fields (by duplicate I mean you went copy then paste so they share they same MC name in the library)
2) use regular expressions - what parameters exactly are you trying filter
you may find this helpful: http://donttrustthisguy.com/2008/02/29/utilizing-regular-expressions-in-as3/
read this:
http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7ea9.html
then:
http://snipplr.com/view/6608/as3-regular-expression-basics/
精彩评论