Professional :: Trigger Function When Certain Keys Inputted In Text Field?

May 31, 2010

I have a stage listener for keyboard events, that triggers one of two error checking functions for text field inputs depending on which movieclip the fields are in.  Text fields in certain movieclips trigger a function that checks if the entry is between a certain numerical range, whereas the textfields in the other movieclips test to make sure the text fields aren't left empty.
 
It works fine apart from me not accounting for keyboard events other than letters, numbers and punctuation, or, among others, the Shift key.
 
So what's happening now is that keyboard events outside of numbers, letters and punctuation are triggering an output error.
 
The listener I'm using is:
 
stage.addEventListener(KeyboardEvent.KEY_UP, KeyPressed);
 
KeyPressed is a function that determines which error checking function to run depending on which movieclip window is open.

View 5 Replies


Similar Posts:


ActionScript 3.0 :: Purepdf Has The Ability To Save Formatted Text From A User-inputted Text Field

Jun 15, 2011

I'm wondering if purepdf has the ability to save formatted text from a user-inputted text field. If so, how is this achieved? From what I understand, purepdf is basically iText, and I believe iText has the ability to parse HTML and save formatted text into a PDF. Does purepdf have that same functionality that I can tap into and plug in 'textfield.htmlText' somewhere?

View 4 Replies

ActionScript 2.0 :: Check To See If The User Inputted A Number Into An Input Text Field

Jan 28, 2010

I'm trying to do a check to see if the user inputed a number into an input text field. I'm also running a check to see if the user has left the input blank (which works just fine), but I can seem to get the NaN function working.

(using actionscript 2.0 w/ flash CS3)

Quote:

this.btn_step1next.onRelease = function() {
if ( zipcode.text == "" || zipcode.text == isNaN() ) {
message.text = "Please enter your ZIP code to continue.";
} else {

[Code]....

View 2 Replies

ActionScript 2.0 :: Only Allow Letters To Be Inputted Which Have Not Been Inputted Before And The Empty Box To Be Inputted

Aug 15, 2011

i am having a problem restricting an input text im not sure if this has to be done in two ways or can be solved in one. what i want to do is only allow letters to be inputed which have not been inputted before and the empty box to be imputted i have tried

imput_txt.restrict = "a-z^Letters_str";

but this seems to only let me enter the letters except for LETRST ive tried putting the string outside the qutation marks and other variations i have also tried it with /'s around and before the string.

View 1 Replies

Professional :: Trace Function Output To Text Field?

Feb 26, 2007

How do you send the output of a function to a dynamic text field on the stage instead of the output panel?I have used trace(); but that just sends the value to the output panel.

View 3 Replies

ActionScript 2.0 :: Trigger Script With A Link In A Text Field?

Sep 11, 2003

trigger script with a link in a text field

View 8 Replies

ActionScript 3.0 :: Which Listener Should Be Added To Text Field To Trigger The Change Event

Jul 7, 2011

I m using a dynamic text field in my app. I have added one Event.Change Listener on it. When I type into it with the keyboard, the event triggers. But when i set some text in it when user performs some action, like textfieldName.text = "test" then the event does not triggers. In this type of situation where we are not using keyboard, which listener should be added to text field to trigger the change event?

View 2 Replies

ActionScript 2.0 :: Make An Input Text Field Trigger An Action When User Clicks On It To Write?

Aug 5, 2008

I'm trying to achieve something that I'm sure it's not that complicated, but unfortunately I have not clue how to do it.I have created some text fields. And what I want to do, it's that when the user clicks onthem, in order to start writing, I want a specific movieclip to dissapear.This could be achievable if I knew how to make the textfield behave like a button; but I don't know what code I need for this, as onPress it's not working at all.

View 5 Replies

Professional :: Trigger More Than 1 Function?

Nov 29, 2010

I need to trigger 4 different functions when I move the mouse poiter over a movieclip; do I need to use 4 listeners or can I use only one to call all the 4 functions?
 
Now I do this
movieclip.addEventListener(MouseEvent.MOUSE.OVER, function1);
movieclip.addEventListener(MouseEvent.MOUSE.OVER, function2);
movieclip.addEventListener(MouseEvent.MOUSE.OVER, function3);
movieclip.addEventListener(MouseEvent.MOUSE.OVER, function4);

View 3 Replies

Professional :: Trigger Function When Variable A Certain Value?

Aug 5, 2010

I want a function to be triggered when a certain global var becomes true - I want to do this using an event listener.  I can do it as a one off using an if statement, but how do you set up a listener to trigger the function if the value becomes true at any time?

View 3 Replies

Professional :: Pass The Contents Of The Text Field To Another Text Field?

Nov 8, 2010

I'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)

View 4 Replies

Professional :: Test To See If Inputted Swf Exists?

Apr 6, 2010

I have an input field that asks for a .swf name - you enter the name, hit SUBMIT, and Flash loads that .swf onto the screen.I've coded for an error to appear if the user doesn't input anything, but how to I test to see if the swf exists, and if not, return an error?I have a function called onSwfLoad that runs when the swf loader finishes, triggered by anEvent.COMPLETE in the swf loader event listener - is there something I can put in an if statement there to test if the swf loader found a file?

View 5 Replies

Actionscript 3.0 :: User Inputted Text: Determining If A Specific Character Is C?

May 4, 2010

I'm creating a learning activity for one of our biology classes. The basis of the activity is to test students ability to transcribe and translate DNA into other sequences.I have a dynamic text field where the student would type in a 36 character sequence.

I already know that I can use an if statement to see if all 36 characters are correct. I was wondering if there was a way to individually check each letter the student typed in is the correct one for that line. So if UUAACCGG is the correct answer, I want flash to check and see if the third character is indeed A or not.I know I can do this with 36 individual text boxes, but I was kind of hoping to get away with just one big text box.

View 4 Replies

ActionScript 3.0 :: User Inputted Text: Determining If A Specific Character Is Correct?

May 4, 2010

I'm creating a learning activity for one of our biology classes. The basis of the activity is to test students ability to transcribe and translate DNA into other sequences.I have a dynamic text field where the student would type in a 36 character squence.
 
I already know that I can use an if statement to see if all 36 characters are correct. I was wondering if there was a way to individually check each letter the student typed in is the correct one for that line. So if UUAACCGG is the correct answer, I want flash to check and see if the third character is indeed A or not.

View 1 Replies

ActionScript 3.0 :: User Inputted Text: Determining If A Specific Character Is Correct

May 4, 2010

I'm creating a learning activity for one of our biology classes. The basis of the activity is to test students ability to transcribe and translate DNA into other sequences.

I have a dynamic text field where the student would type in a 36 character sequence.

I already know that I can use an if statement to see if all 36 characters are correct. I was wondering if there was a way to individually check each letter the student typed in is the correct one for that line. So if UUAACCGG is the correct answer, I want flash to check and see if the third character is indeed A or not.

I know I can do this with 36 individual text boxes, but I was kind of hoping to get away with just one big text box.

View 0 Replies

Professional :: Text Jumps After Embedding Font In Dynamic Text Field?

Jun 10, 2010

Im using a standard font (Gotham rounded) within a dynamic text field. As soon as I embed the numerals within this text field the text lowers within the text field.Double clicking the field then renders the text higher up! It seems that the height it shows when I double click is the height it compiles atThe other strange and annoying thing is that my colleague working on the same project is using the exact same font and same file but this doesnt happen to him and so the font redners out differently when he compiles

View 1 Replies

Professional :: Dynamic Text Field Not Displaying Text Even When Font Is Embedded?

Jan 16, 2011

So, I have some basic actionscript code.  It's a legacy site, so I'm using AS2.  The line of code simply does this:
 
myField.text = "some text"
 
So, I select the text field on the stage, then ensure the font is embedded.  All the glyphs I want are checked, but then when I compile and test, the fonts don't show up when the code is executed.  Instead, the textfield is blank!  What happened?!  Where did the text go?
 
I should mention that the .swf which I compile is loaded into another parent .swf during runtime.  If that parent .swf does not contain embedded fonts, is that why it's broken? 

View 1 Replies

Professional :: Text Added To Text Field Using Variable Doesn't Appear

Oct 4, 2010

I have a test field that I've created dynamically.  If I add text to it by writing: myField.text = "some text"  the text appears, but if I add text using a variable I don't see anything.  If I trace the text field's text trace("text = " myField.text) I get the right value.

View 6 Replies

Professional :: Tabulating Text In A Dynamic Text Field?

Aug 5, 2010

I'm building a site for someone that has dynamic text fields inserted as objects in the timeline.  These text fields aren't interactive, they're only dynamic to allow scrolling and external links.  I need to be able to tab right a couple of times (like you would in a word document) to arrange a handful of lines of text in a tabular format.  I want to be able to do this to just a couple of lines in the middle of the body of text, not as a separate table, but the tabs need to behave like regular tabs in that the text will always align correctly.

View 1 Replies

ActionScript 2.0 :: Function Not Updating Text Field & Variable

Jan 12, 2009

I have a function that is suppose to update a variable which updates a textfield and it is not working.

[Code]...

View 0 Replies

ActionScript 2.0 :: Function That Changes The Background Colour Of A Text Field

Aug 19, 2005

I have a function that changes the background colour of a text field:

Code:
function changeColour() {
_root.ticker_txt.backgroundColor = "0xFFCC00";
_root.ticker_txt.background = true;

[Code]....

If I move the changeColour(); call outside of the unpause(); function - it works perfectly!?

I am sure it is the way I am refrencing the textField - but everything is in the same moviclip/scene/frame - so _root should work surely?

View 2 Replies

ActionScript 2.0 :: Pass Text From Form Text Field To A Flash Dynamic Text Field?

Feb 3, 2007

Currently 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.

View 1 Replies

ActionScript 3.0 :: Populate A Dynamic Text Field On The Stage From A Function?

Oct 21, 2009

I am using a gallery written in AS3.0 called SlicedCubeGallery. It used Flex to publish the gallery.I can edit the functions for the SlicedCubeGallery, and the one I am targeting is the one that swaps the images (which I have running on a timer).I am loading the whole gallery SWF onto my stage using this code:

var request:URLRequest = new URLRequest("slicedCubeGallery.swf");
cubeGallery_mc.load(request);
addChild(cubeGallery_mc);

[code]......

View 6 Replies

ActionScript 3.0 :: Display Function Results In A Dynamic Text Field?

Aug 6, 2011

i have two functions written to work out the time until lesson starts.

However, if i try to output the results in a dynamic text field, it doesn't work? It only works with the trace method?

View 5 Replies

ActionScript 2.0 :: PHPBB - Login Through Flash Using One Dynamic Text Field And One Input Text Field And No Buttons?

Jul 17, 2003

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 Replies

ActionScript 2.0 :: Calculator - Clear The Text Field Then Store The New Input In The Same Text Field As A Different Variable

Mar 30, 2006

I'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 Replies

Professional :: Html Into A Dynamic Text Field?

Aug 5, 2010

I'm able to use a .txt file with basic html elements inside to display correctly. But I now have a structured document done in ms word. If I copy the html and try to save as a .txt file it will only allow to be saved as .rtfis there a way to preserve all the font, breaks and styles from a doc saved in .rtf or can I do this in a different way.

View 1 Replies

Professional :: Changes The Alpha Of Both The Black Field And The Text

Oct 25, 2010

I have imported an object "DD_dropdown_clip" from the stage with this code:

[Code]...

The object is a black field. The fn "setup" writes text on this field. The problem with the code commented out is that it changes the alpha of both the black field and the text, whereas I simply want to change the alpha of the black field. How can I do this? Can I do it in the IDE?

View 3 Replies

Professional :: Input Text Field Won't Type?

Dec 8, 2010

when published my flash won't type text into input fields (unless there's already text typed in there before publishing) the cursor doesn't appear although the pointer changes to indicate an input field.

View 5 Replies

Professional :: Text Field Number Validation?

Dec 13, 2010

I'm trying to figure out Flash CS5 on my own, and this should be easy, but... All I want to do is validate that the text entered in a text field is a number when a button is clicked. It can be a positive, negative, or decimal, but no letters or symbols.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved