ActionScript 3.0 :: Text Field That Only Accepts NUMBERS
Apr 1, 2009I've tryed to make a textField only accept Numbers. I've embeded only numbers between 0-9 but I can still add letters.
View 6 RepliesI've tryed to make a textField only accept Numbers. I've embeded only numbers between 0-9 but I can still add letters.
View 6 RepliesThe input fields are a 'Classic Text' input field, and part of a Flash app I made last year for a client. The Flash was made with Flash CS4 on a Mac OSX 10.4, and was published last year and has been working all year.At some point recently I upgraded to Flash CS5 (this time on a PC), and I also had to re-compile the Flash app for a miscellaneous reason (a new image in the app). I left the publish settings alone (Flash 9, AS3) and re-published the Flash and put it up live. As far as I can tell everything was fine.Now the client is coming to me saying they can't enter numbers on the input fields, only letters !!!Aside from the transition to CS5, or an upgrade in Flash Player in the browser, I can't think of what else would cause a problem.
In troubleshooting this, I did notice for the first time the feature of 'TLF Text'. I have never used it, but when I copy the form MC to a test file and run it with TLF fields, they accept all characters including numbers. When I switch a field back to Classic Text, I can no longer enter numbers.
How can i Take only numbers into the text input field...
View 1 Repliesis there a way to only allow a user to enter numbers in a text feild. setting embed text to numbers only worked for a while, but have to embed all now.
View 1 RepliesActionScript Code:
// create text fields to hold debug information.
this.createTextField("counter_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
this.createTextField("debug_txt", this.getNextHighestDepth(), 0, 20, 100, 22);
[Code]....
I want to play an animation when the sound gets to the 4 second mark and then again at the 17 second mark. So in the updateCounter function I add in:
ActionScript Code:
function updateCounter() {
counter_txt.text++;
[Code].....
I want to use a dynamic text field to display the numbers, but have a few buttons that go with them.I want to be able to press the button, and a set time is generated in the dynamic txt field, i.e. 10 minutes, 15 minutes & 30 minutes. the user will press 30 minutes, then start, then the countdown will commence, and same for the other time increments.
View 1 RepliesI just need to display Numbers as well as in Words also in the Text field.
For example
99999 - NINETY NINE THOUSAND NINE HUNDRED AND NINETY NINE
for this i plan to use Array
like seperate the given numbers to array ([9][9][9][9][9])
then convert these number in words
how do i make a text field that u can only enter numbers? nothing will happen if u type something other than a number.
View 6 RepliesI need to create a text field where the user can only write numbers from 3.0 up to 12.0 with any decimal. With any number he imputs i need another text field to store the number lowered to its nearest .5 number.
for example
input 3.1 result 3.0
input 3.4 result 3.0
input 3.6 result 3.5
input 4.6 result 4.5
By the way. im using Flash CS3
I've been asked to make a flash countdown timer. I want to use a dynamic text field to display the numbers, but have a few buttons that go with them. I want to be able to press the button, and a set time is generated in the dynamic txt field, i.e. 10 minutes, 15 minutes & 30 minutes. The idea is that the user will press 30 minutes, then start, then the countdown will commence, and same for the other time increments.
View 3 RepliesI need to create a text field where the user can only write numbers from 3.0 up to 12.0 with any decimal. With any number he imputs i need another text field to store the number lowered to its nearest .5 number.[code]...
View 9 RepliesNeed a code that only accepts numbers. Upon inputting, the code must check if it is number, if not, it must remove the entered key or not enter it at all
View 6 RepliesI have a movie where a variable named daysleft will be loaded from an external text file into a dynamic text box, this bit works fine. But I then need the movieclip "numbers" to gotoAndStop to the frame number imported via the variable daysleft. Although daysleft displays on the screen a trace(daysleft); says the variable is undefined.
View 4 RepliesCurrently I'm using javascript which works fine to pass text from textfield A to textfield B:
Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.
Is it possible to login through flash using one Dynamic Text Field and one Input Text Field and no buttons? If so how? I have seen many tutorials dealing with logging in to PHP using flash but it requires you to make your own php scripts which i am not familiar with. Can some one tell me how to do this with PHPBBs existing php scripts... I want to be able to login thorugh a Input Text Field box and have it verify it in PHP and also be able to register and view other PHP info such as users online and FAQ..
View 2 RepliesI'm making a calculator using Flash MX that works the same way as the basic calculator found on windows (not the scientific one). But having the user input a number, store it as a variable, store which function the user wants to perform and clear the text field then store the new input in the same text field as a different variable and multiply or add or divide or subtract the 2 numbers and getting the equals sign to display the answer when clicked is harder than I thought it would be.
View 3 RepliesI am working on a file that has a rotating dial, and I'd like the dial to reveal contents of a text field (a link) as the dial points in the direction of the text field. I have 4 text fields located at 90, 180, 270 and 360 degrees (top, bottom, left and right). I have it controlled via AS, so I've got all the Math but I was hoping someone might know how to reveal the links when the arrow (in the dial) is pointing in these directions.I set up a text field for testing, which shows the degrees, but I'm getting 'NaN' in the field (problems with Theta and converting degrees to Radians, I think). I thought this might help me figure out how to reveal those links, if I can get the NaN to work.Currently, the file is rotating with an onPress, but I'm going to convert it to a mouse follow, instead, so the user only has to float around to see the links.
View 5 RepliesI'm trying to make an input box restricted to characters 0-9 including the space bar.
I can do;
mytext.restrict = "0-9";
but how do I account for space?
What I'm trying to do is to write something in an input field and then it should show up in a dinamic field. I can make this happen, but the problem is that the dinamic field shows its new text in the same format as the Input field. For example, the input text is written in TimesNewRoman and the dinamic text is in Arial, but when the dinamic text shows the input, the text is still in TimesNewRoman when I want it to be in Arial.
View 11 RepliesI've created a dynamic text field - mediaImportName001 (created , and populated it with the name of a file that I choose to import using a browse button (as3 and AIR).This works fine - I can import the file, and the name appears in the field.
I'd now like to pass the contents of the text field to another text field. But I can't get the contents. If I try to trace the contents of the textField trace("mediaImportName"+thisNum).text - Flash returns "undefined" (even though I'm asking it to trace after the field has been populated).
I use the following code to check that the field really is there and named correctly (the code returns the children):
for (var i:uint = 0; i < this.numChildren; i++){ trace (this.getChildAt(i).name + ' type:' + typeof (this.getChildAt(i))+ ' ' + this.getChildAt(i));}
it returns:
instance370 type:object [object Shape]mediaImportName001 type:object [object TextField]mediaFiletype001 type:object [object TextField]
How do I get Flash to give me the text in mediaImportName001?
It's bizarre - this.getChildAt(i).name
from above gives me...
mediaImportName001 ,
yet
trace (["mediaImportName"+thisNum].name);
returns undefined (thisNum represents an increment I use to name multiple clips and text fields, and in this case trace(thisNum); returns 001)
Is there a way to detect when the user accepts the Privacy Pop-up?
Basically, I'm using the microphone to record a voice message. I'd like to start a countdown timer that tells the user how much time they have to record their voice.
I start the countdown timer on the same event that I call nsPublish.attachAudio(microphone), and the countdown starts immediately, even though the user sees the privacy pop-up.
Is it possible to make a dynamic class in AS3 only accept dynamically created properties if they're a given type?For example, I may only want Sprites to be allowed. So take this quick example class:
public dynamic class Test extends Object{}
And a few quick lines to get an idea of what I mean:
var test:Test = new Test();
test.something = 32; // error
test.something = "party hats"; // error
test.something = new Sprte(); // works
Maybe using the proxy class/namespsace there's a way to manipulate whatever is run when creating variables dynamically?
I am trying to automate the input process so that when a user inputs 3 numbers into the first field, it automatically jumps to the next one. I have the code to do it and it seems as though it should work but, for some reason, when I move focus from one field to the next the data in the previous field is re-arranged so that the last character input becomes the first (610 becomes 061 - for example).Here is my code:
Code:
phone1.width = 30;
phone1.move(10,10);
[code].....
i want to write a function that is used by multiple buttons and accepts a variable when it is called by a given listener..
ActionScript Code: this.fileBTN.addEventListener(MouseEvent.MOUSE_OVER, menuSet("fileMenu"));
function menuSet(what:String){
trace(what);//should trace back "fileMenu"
}
I want to make a search button on my site. I have a bunch of pdf files in a specific location on my site. I want to create a search field where the end user inputs text into a field and flash locates and opens the corresponding pdf file.
View 1 RepliesTrying to get a text field in my Flash MX movie to pull from and XML file with CDATA tags to show as HTML. I've checked the box to render as HTML for the text data field... but I'm having problems with the Actionscripting.
The field from this line is what I need to recognize as HTML reading CDATA tags:
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
I know I need to do more than just change it to ".html" instead of ".text" and have tried a couple things, but nothing seems to work.
Code:
//Create the XML Object
myXML = new XML ();
myXML.load(newXml);
[Code].....
How can I type something in my input text field without clicking on the field first? Basically I just have one input text field on the stage and when I Test Movie I would like to just type in some text without clicking on the field...
View 1 RepliesI have a dynamic text on the stage which gets updated (shows numbers) when some buttons are pressed.I just need to know if it is possible to show the first dynamic textfield in another dynamic textfield.Lets say the first dynamic textfield called "price" and the second one called "price2". when a button is pressed, the first dynamic textfield "price" will show a number. is it possible to show whatever is shown in the "price" in "price2" ?
View 1 RepliesI'm creating an XML-driven pie chart in AS3 with 2 text boxes in each pie slice. Both text fields are dynamic in the sense that they are populated by the XML doc and then told where to place themselves in the AS3. I've got them both using the same x and y position to place themselves at the moment (which of course puts them right one top of each other), but I'd like to make one of the fields (which acts like a label or a title to the larger number and % text field) place itself in a particular spot around the other text field. The result I'm looking for is to have the smaller "title" text field appear approximately 5 pixels above and left-justified to the larger "percentage" field.
Anyway, here are two sections of code that I've currently got. The first chunk, for the Tags portion, sets the position for the "percentage" text field using a good old x and y method. The second chunk, for Titles, is setting the position for the smaller "title" text.
//evaluate tags
private function evaluateTags():void{
for (s=0; s
[Code]....
Problem: I am trying to get a very simple text resize going, for my main content area in a flash website. My aim is to get a button, that on click, increases the text size of a dynamic text field.
[Code]....
This is what I tried, I am very new to Action Script, so excuse the futility of my code.