ActionScript 2.0 :: Setting Validate Range For TextField - Check With Array Of 3 Inputs
May 29, 2007
I was supposed to set the validate range for the Name field to be checked with an array of 3 names, the validate range for the Password field to be checked with an array of 3 passwords, and the validate range for the State field to be checked with an array of 3 states in order to create my own error messages.
stop();
var errors:Array=new Array();
function clearForm() {
name_ti.text="";
state_ti.text="";
password_ti.text="";
[Code] .....
i dont know how to validate enabled input field by a checkbox.
I got 4 checkboxes each of them enabling/disabling its own input field when checked/unchecked. This for a little explanation of the user's choice. So i need to validate if the enabled input text has some text in it, if not, restrict the submit of the form (by button).
I tried something like this:
Code: } else if (checkBox1_txt.enabled = true || checkBox1_txt.text ="") { status_txt.text = "Please, explain your choice";
I'm looking to validate and email address and I found how to check for a single dot with email_txt.text.indexOf('.') < 0 but I want to also want to check to see if the user may have entered twoI tried: email_txt.text.indexOf('.') < 0 || email_txt.text.indexOf('.') >2 but that makes it puke all of the time.I also tried: email_txt.text.indexOf('.') < 0 && >2 and that one threw all kinds of errors.
what I want after pressing the button (calculate_btn)is to get thees values entered from these input texts into 3 vaiables.
var $money var $percent var $years
and check if the inputs are numbers only not string not empty. I tried to convert the inputs to numbers to insure that they are numbers without making a function to check the inputs but always I get NaN when I entr value like 444bb;
ActionScript Code: error_txt.text = "Enter some values to calculate your loan"; //--------Make the button listener----------//[code].........
I have a number like this 22536325214589 and I want to separate it by 4 digits and show in separated input textfields like serial number input on applications and if user try to change it skip to next field while typing And also I can return number again into one variable.
I have a movieclip with a textfield with its variable property assigned to an external variable. I need a way of knowing when the value has changed to perform some actions, and also if possible to validate the value before it is assigned to the textfield. Is there a way to acomplish both this tasks in AS2?
What I am trying to do is create a root variable that can simultaneously equal a range of numbers. But I cant use the for command because the variable it will assign will only be confined to those brackets and can only be pulled from code inside the brackets
I'd like to check if a mc's _x and _y properties are between a certain range, but can't find out how to. Now that I'm typing this (I can't check it in Flash right now at the moment), I'm thinking if this will work:
let's say the mc is called mcMyMovie and it has to be between 90 & 100 (both for x and y)
I'd like to check if a mc's _x and _y properties are between a certain range, but can't find out how to. Now that I'm typing this (I can't check it in Flash right now at the moment), I'm thinking if this will work: let's say the mc is called mcMyMovie and it has to be between 90 & 100 (both for x and y) if(mcMyMovie._x =< 100 && mcMyMovie._x =>90 && mcMyMovie._y =<100 && mcMyMovie._y =>90) { } Would this work or is there a shorter way to write this down in code ? In maths I'd write something like 90 < mcMyMovie._x <100.
I'm looking to create an AS3 driven animation that animates starting from 0 to 365. I would like to have 0 appear at the start and then randomly and slowly start spinning through numbers really fast ranging from 1-365 for about 5 seconds and slowly end on 365. How complex would something like this be?
var str:String=cntslst.text; var results:Array = str.split(","); for(i=0;i<result.length;i++) {<mx:NumberValidator source="{result[i]}" property="text" id="cell" />} Is it possible ?
I'm trying to create an simple (yet I still can seem to do it) task where a user has to enter a prevously worked out number into an input box clicks a button and get a correct or incorrect message.I need the number that they enter to be a numer within a range ie. 1.0 to 1.9I have 2 text boxs on stage... 1 an input text box (called inputBox) and the other a dynamic text box (called answerBox) also the is a button on stage to exec the scripton the root timeline the script is:
How woud you go about saying if _xmouse is greater than 200 but less than 350, do these actions. How would you write that in actionscript? I was trying :
I've run into a strange Vector out of range error when trying to splice a Vector array. The idea is to cut off the Vector array after a certain point....
var vec:Vector.<int> = new Vector.<int>(); vec.push(1);vec.push(2);vec.push(3);vec.push(4);vec.push(5); vec.splice(3,vec.length); // output RangeError: Error #1125: The index 5 is out of range 5.
The strange thing is that it works perfectly, if I change the Vector to a regular array like:
I've run into a strange Vector out of range error when trying to splice a Vector array. The idea is to cut off the Vector array after a certain point...
ActionScript Code: var vec:Vector.<int> = new Vector.<int>(); vec.push(1);
I have a standard array with some text items and some numbers.
Here is an array item
ge: 65, (no quotes around this number)
Here is the DataProvider line (the section that applies to my example)
DataProvider([{label:"over 60", data: 65}]);
Here is the search line
for (var n; int = 0; n<arrayname.length; n++
arrayname[n]. Age == search_age.selectedItem.data
This works fine because the array number MATCHES the selectedItem data number (65) exactly and I get all records where age is 65
BUT I want to find records whose age is any number "greater than 60"
I have tried many ways to use the > sign and keep getting an error, example:
DataProvider([{label:"over 60", data: >60}]); or DataProvider([{label:"over 60", data: (>60)}]); or DataProvider([{label:"over 60", data: >(60}]);
None of these work.
Maybe these aren't numbers? I've tried putting 'int' in various positions with no results. I'm using a DataGrid which works fine for text items and will find numbers without quotes around them (if those numbers match whats in the array!).
What's the way to write this so I can get records greater than, or less than, etc.?
I want to subset an array. I have the following array
[Code]...
Now based on user requirement I want to select a range of sell data for some month.For example sometime it may be sells data from Apr to Dec,sometime may be Jul-Oct.How can I do that without hampering the original array
I have some variables created on the main timeline and a mc called options which will be where those variables can be manipulated. A way I've tried to this is by creating a first array(array1) and populating it will all the variable names found on the main timeline, and another array(array2) containing the values of the variables the user has changed(which are displayed on some dynamic text fields). To make these changes, an "apply" button is pressed which will set the values found in array2 to the variables in array1.[code]How would you do this so that var1, var2... are updated properly according to the values found in array2?And because array2 contains strings(read from dynamic textfields), how do you deal with that since var1 and var2 are numbers?
I'm using createTextField to create a textfield. I have also created a input textfield with a variable called textline1 (I don't create the inputfield with as).I want to display the letters in the created textfiled that I'm typing in the input field. So this in my AS coed:
_root.createTextField("text1",1,100,100,300,100); text1.variable = textline1; format1 = new TextFormat();
I am trying to figure out why some letters (like the norwegian Ã… (Ã…)) are cutted out in the middle of the top "o":
My code is this: var titleFormat:TextFormat = new TextFormat(); titleFormat.size = textSize; // this is embedded font, and exported for action script, declared titleFormat.font = myFontBold.fontName; titleFormat.bold = true; [Code] .....
So, I have tried different things like setting height hardcoded and bigger than text, but top us cutted again, I have tried with css but no success. Why the letter is not showed fully and why if I zoom in the swf (2-3 zoom ins) it shows up normal (and what i try to achieve) like this: I think it has to do with the topMargin, but unfortunately I didn't find something like that in as3 documentation.
I was trying to create these 17 textfields in a for loop. I ended up instanciating them manually and now I am trying to set some of their properties in a for loop. The problem is that when I trace them I just see [object textfield] but not the names. If I try to trace the ".name" I get instance 1, instance 2, etc. The real problem is when I try to set the "y" property I get an error "1010 A term is undefined and has no properties"
Code: var tf1:TextField = new TextField(); var tf2:TextField = new TextField(); var tf3:TextField = new TextField();
I have another post on here today about trying to set a textfield's text in AS2. I have been working on this problem all day. I am beginning to wonder if it is due to the fact that the fla was authored with CS4, maybe even CS3 and now I am trying to use it in CS5.5