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.
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.
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.
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?
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 {
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.
I have been instructed to develop a banner that has a text field for a user to input a zip code and when they click locate, a URL is opened with a static url.com address + the zip code they entered.
For example [URL]
When user inputs the zip code 92912, a getURL is opened with the website located [URL]
what actionscript I have to use to add the input text to the end of the URL, or how this can be done?
I have been instructed to develop a banner that has a text field for a user to input a zip code and when they click locate, a URL is opened with a static url.com address + the zip code they entered.
For example [URL]
When user inputs the zip code 92912, a getURL is opened with the website located www.testsites.com/92912 .
what actionscript I have to use to add the input text to the end of the URL, or how this can be done?
I am trying to compare a user inputted string to a variable already created. When I do this with int it works fine but when I try changing it to strings I can't get it to work.
How should I go about matching the selected row of a sorted DataGrid to its source data row within its associated data provider?
For example, once a user sorts a DataGrid by clicking on one of the column headers, the target.selectedIndex from the CHANGE event (generated next time a row is selected) represents the index of the sorted row and not the index of the data as supplied by the data provider. Is there a simple way to map the index of the user selection back to the index of the original data?
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.
I'm making a little program that has to count specific characters in a string. Let's say the user inputs a name (I.e. "John Jabbadoo Jackson") and I need to count all the o's in the string. In this case it should be 4. How would the script look like?
I'm making a little program that has to count specific characters in a string. Let's say the user inputs a name (I.e. "John Jabbadoo Jackson") and I need to count all the o's in the string. In this case it should be 4.
can someone teach me how to convert the code? when character reach frame 10,scale/flip the char horizontal. i tried e.currentTarget.scaleX=-1; but the char seems to move till off the stage.. without flipping the char,my char gone facing <--- instead of going ----->...
Any way to change the specific character's colour within a string in a dynamic textfield. E.g. String = "There can be only one" I want all the o's to be orange...
How can I turn every specific character in a word in a textbox to specific color? this works like highlighting. If I have the word Jeeves in TextField object, I would like each occurrence of Jeeves in this TextFIeld to become red or any other color. In AS2 I had to search the text for keywords and use the TextFormat class. and then handle keypresses for the textbox for highlighting as the user is typing. How can a highlight a text in dynamic text field?
My pseudo code is given below: /***Handles Keyback, it should delete the pevious char entered in the text box*/ private function handleDelCharEvent() { aArray[nCurCharInd] = ""; Text_mc["TextEntry_txt"].text = ""; stmpTxt = ""; if (nCurCharInd > 0) { [Code] .....
I have a dynamic text box on top of a moviclip of a rectangle. I need the width of the rectangle movieclip to adjust according to the width of characters in the dynamic text box.Is there a way to determine the width of the characters in the dynamic text box?i am having trouble figuring this out
I want to populate a dynamic text box and then scroll this. Is there anyway of determining how large the text area's height needs to be given the width and the text I want to populate it with?
I want to modify the Flex 3 TextInput control to accept a tab character as valid input (The app allows the user to enter an arbitrary delimiter string for file output formatting, and tab is a common use case). However, clearly in the default implementation the tab key changes the form focus away from the selected control.
I want to implement paging in a spark text area. For that I want to find out the number of lines a spark textArea can hold before the scrollbars appear and just feed that much lines to the text area.
I want to create an input box which directs a user to a specific frame, based on what they enter.I'm making a text-based adventure game, in homage to the ones of old, and basically, if someone enters say the word, "light" into the box, I want it to take them to the frame labelled "light".I also want the input box to respond ONLY to enter key pressing.
I'm using Flash CS4 with AS3. I'm building a website for a friend the problem I have. When a user clicks on a button I want it to play a movie clip then stop at a specfic frame. I want all the buttons to play the same movieclip but go to a different frame.
The current actionscript I am using is located on frame 1 is: home_btn.addEventListener(MouseEvent.CLICK, homebuttonClicked); function homebuttonClicked(event:MouseEvent):void{ gotoAndStop(0) }about_btn.addEventListener(MouseEvent.CLICK, aboutbuttonClicked); function aboutbuttonClicked(event:MouseEvent):void { gotoAndStop("aboutme") [Code] .....
This allows me to navigate to the right frame but does not play for obvious reasons, if I use the gotoAndPlay function its carries on playing to the end of the movie.
I need to allow the user to create a circle with a specific radius and colour in a certain frame (lets say frame 2), and then add that circle as a symbol to a different frame (say frame 1). First off, im simply creating a circle.. This is what ive got in frame 2 so far:
I was thinking that it may be possible to create a primitive, yet usable actionscript based text to speech system for Flash movies (One that is platform independent).
Is it possible to right a series of actionscript commands that would play a collection of certain sound files based on what word or words the user has entered?
For example:
If the user types "Red Pen"
Can actionscript tear apart those two words and play sound files "Arr", "ee", "Dee", "Pee", "ee" and "EN"?
If it is possible, and if someone could help me out on it, then I'll start figuring out what phonetic sounds I'll need to record and program, and see if I can't build a simple text to speech program for flash movies.I have no immediate commercial application for it, and I don't plan on one.So if I can pull it off it'll be free to everyone, source code and all. Of course, it may be in my voice, but it shouldn't be hard to take what I plan to do and use it as a template for anyone else's voice recordings.
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?
and a submit buttonI would like to be able to add up all the numbers inputted into the first three dynamic fields by the end user and the result displayed on the 'answer" field.