How to leave the input field to accept more than one "specific" response

Hello

I work for something and try to create a game show type-box-based for one of my classes, where a text entry field can change that is the border color if 2 or more words from a list of recognized words is registration.

For example, a list of possible answers a: R, G, B, Y to the question "name 2 colors»

I want to create an input text area where the border of the box changes color if the 2 letters (in the list above) are entered in it.

I tried implementing a variable NumberSuccesses and set so that the number increases by 1 for each letter entered for example

If (Ex.text is "R");

NumSuc = NumSuc + 1; var NumSuc has already been previously defined in the code

If (Ex.text 'G')

NumSuc = NumSuc + 1

If (NumSuc == 2)

Ex.borderColor = 0x0000FF

but it does not work... and I tried to do it with another function which I use for several text boxes as if there are boxes A, B, C. I could set up a general function where if the correct answers were entered into A, B, C respectively, only then will say, a check mark appears by using a

EnableCheckmark (); function of type. Don't know how to do if it is the same text entry box well. Also just tried adding in the same function re.

If (Ex.text is 'R' + 'G')

Ex.borderColor = 0x0000FF

.. Does anyone know what I can do?

The solution of Mathias with the logic of the evaluation:

What are the possible answers

var solutions: Array = new Array ("A", "B", "C", "D");

function testInput(_inputText:String):Boolean

{

the delimiter could also be a comma, it's here a space

var inputStringArray:Array = _inputText.split("");

var counter: Number = 0;

for (var i: int = 0; i

{

for (var j: int = 0; j

{

If (inputStringArray [i] is [j] solutions)

{

counter ++;

}

}

}

If (counter > = 2)

{

trace ("true");

Returns true;

}

on the other

{

trace ("false");

Returns false;

}

}

TextField with the name input_txt onstage

input_txt.addEventListener (TextEvent.TEXT_INPUT, answerTxtInp);

The function that will be called by the event listener

function answerTxtInp(txtEvent:TextEvent):void

{

According to the responses of characters, change the color of the border

{if (testInput (input_txt. Text))}

input_txt. BorderColor = 0xFF0000;

}

else {}

input_txt. BorderColor = 0 x 000000;

}

}

Tags: Adobe Animate

Similar Questions

  • How can I associate my rt surface with more than one account of sky drive

    How can I associate my rt surface with more than one account of sky drive.

    You will need to create a new account on the computer by using the Microsoft Account associated with the other SkyDrive.

    To create a new user, open laptop settings, in the general section, click 'add a new user '.

  • How to create the text field that accepts (only Alphabates no numbers or numbers)

    Hey guys,.

    I just want to know how to create a text field that accepts (only text without characters or numbers)?

    I want to insert validation that field only accepts the alphabates no number or numbers are allowed!


    Thanks in advance!

    In the designer, click the field that you need to validate and open the script window, together the menu show drop-down list to validate in the drop-down list and place the code in the script window. Make sure that the language is Javascript and run is defined on the Client. If you don't see the script window goto window-> Script Editor Menu item.

  • Header record not repeated when the detail records extend to more than one page

    Model RTF,

    1. I have one for each code of

    <? for-each@section:G_HEADER? >

    2. under "for-each", I have the header of the document is set in a row of the 1 table.

    The row for this table property is set to 'Repeat as header at the top of every page'

    3 in this, I have another table with the fields for data LINES with its own code "for-each" <? for each: G_LINES? >

    4. follow-up of the end for the two above "for-each".

    However, when I generate the PDF output in overview, data lines extend to more than one page, the header record is not repeated on the following pages. Anyone has any ideas of how to solve this

    My version of the XML Editor is 10.1.3.4.1 build 130. I have an example of data and model, but don't know if I can download it here.

    Use this logic


    INFORMATION HEADER TABLE

    DETAIL TABLE

    and keep this in the header then it is displayed even though the detail data go to more than 1 page.

    If this helps please give me a few points

  • Why can't hit the goback button and back more than one page

    Upgrade from 6.3 to firefox 8. When I use the back button I can't go back more than one page. I use to be able to go back as many pages as I wanted to. Use win xp sp3 fully implemented to date, 1 GB memory pentium 4.

    Thanks for your answer to my question. I use Noia for my theme and like how the buttons next and previous are willing. I found the solution for my problem the about: config > browser.sessionhistory.max_entries is set to 2. I changed it to 50, and problem solved. Thanks for your help.

  • How to disable the input fields using backing bean

    Hi all

    I use jdev10g ADF. can someone help me how to disable all fields on a page by clicking on a button?
    I say 10 fields and a read only field that has a value of default db 'Pending'. I have a button that, when I click, I disable all the other fields and change the value of the field read-only 'closed '.
    How can I do this method of bean pressing button?

    Thanks for any idea

    Preeti

    You need not to do this a bean of support. Instead on the components that you want to disable write an EL expression for the disabled attribute something like this:

    #{bindings.yourfield.inputValue == "CLOSED"}

    CM.

  • How to configure the bookmarks bar to view more than 4 bookmarks?

    In Firefox to. 31.0, I can add multiple bookmarks to the bookmarks bar, but if I added more than four bookmarks on the toolbar and then close Firefox, the next time I open it it there are only four bookmarks in the toolbar. I've been a techie years so I tried everything I can think of including adding bookmarks different ways... by slip and fall and/or 'Bookmark this Page', click on add to the toolbar but still, I allowed four bookmarks in the toolbar after a reboot.
    Any suggestions?

    Other bookmarks moved into the overflow area and appear in the drop-down list of chevron or moved from the bookmarks toolbar?

    You can check for problems with the database places.sqlite file in the Firefox profile folder.

  • With the help of programs in more than one computer cloud creatives

    Can we install all programs in addition to a computer with a creative cloud with the same monthly cost?

    Yes, you can use applications desktop cloud creative on two computers at once, regardless of the operating system of the individual associated with the composition of the creative cloud. See the page of the product license agreements for more information

  • How can you ask a question that requires more than one sentence (although the limitation of the device seems to be characters)?

    Well, that answers the question above. Now for the real question. I need to regain my search bar of alternative search engines, and I don't want to start typing a search to get them (bad idea). I found the suggestion below but have no idea how "middle click" or how to get to the page mentioned "config". Can anyone help?

    If you want to restore the window previously used independently to manage search engines, you can enable or disable this pref to false with a medium on the subject click: config page.

       about:config page: browser.search.showOneOffButtons = false
    

    You will need to close and restart Firefox to make it work properly.

    You can open the topic: config page via the address bar. You can accept the warning and click on "I'll be careful" to continue.

       http://kb.mozillazine.org/about:config
    

    Type Subject: config in the address bar (address) and press the enter key to open the topic: config as you open a Web site by typing the URL in the address bar of the page.

    • If you see a warning message, so you can confirm that you want to access the comments: config page.

    You can use the search bar on top of the on: page config to identify preferences more easily and in this case you can type from time to time until you see the browser.search.showOneOffButtons preference.
    Preferences that have been changed and do not have the default display in bold (the user's game).
    You can toggle this Boolean False pref with a double click on the line with the pref or use edit on the shortcut menu.

  • How to use the conditions where there are more than two options

    I have a blade that collects information from the user and then makes decisions based on the values entered. On a slide I use the widget drop-down list and list of"basic", "Intermediate" and "Advanced". I hoped to do is use the Coditional Structure as follows:

    1. If the Basic was selected slide goto BasicQuickQuiz
    2. If the intermediary has been selected goto slide IntermediateQuickQuiz
    3. If Advanced was selected slide goto AdvancedQuick Quiz

    I can make this work for Basic or intermediate, but I don't see how (or even if) I have a multi level if statement.
    My work is about:
    1. a button added logic:
    So basic, then got otherwise BasicQuickQuiz goto IntermediateQuickQuiz

    2. on the Enter slide on IntermediateQuickQuiz event:
    If the intermediary, then keep, otherwise goto slide AdvancedQuick Quiz

    It works, but it seems awkward - y at - it another way that this goal could be achieved?

    Tim

    What I was hoping to see was the ability to create several Else If statements within the only condition. I've changed it now to add two conditional statements, one after the other, but still find this unscrupulous feature.
    I will record a feature request to add a Select Case block / Switch style fuction to this group.
    However, since it is new I can live with the workflow (for this version of Cp anyway!)

    Tim

  • How can I set up a contact in the address book that contains more than one address?

    I am new to TB. I want to be able to create a group of addresses as a contact in the address book that will allow me to send my message with a single contact instead of having to add several contacts to email.

    Thanks for your help.

    LK

    _ http://KB.mozillazine.org/Thunderbird: _FAQs_:_Create_Mailing_List

  • How to increase the time-out value for more than 15 seconds?

    Find a web page expires at 15 seconds. I want to set the timeout for a longer period of time. I don't find a place to do this in the Options. When I go to full pages, I want to continue to try more rather than keep hitting the Try Again button.

    The parameter for which is not in Firefox, it must be changed in Windows.

    http://drewthaler.blogspot.com/2005/09/changing-DNS-query-timeout-in-Windows.html

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DNSQueryTimeouts
    Multiple string: '0 1 2 2 4 8'-> "4 8 8 16 32 0".

  • How can I send a video Message to more than one person?

    HOW CAN I RECORD A VIDEO MESSAGE, I DID IT, I CAN SEND THE SAME AS OTHER PEOPLE?

    Right-click on the preview image of the message, and then select record under.

  • The use of Bitlocker on more than one drive

    I am running windows 7 ultimate at home.  I want to activate bitlocker on my system drive and the data reader.  I noticed when I was going to make it work on my data disc it has options for the use of passwords, smart card or not password protecting.

    My question is if I encrypt my system with a password disk and my disk of data with a password I have to enter a password when I need to access my data disc?

    OR if I leave my data encrypted without password disc will be will someone out this player and access its content?  Or will I be paranoid?

    Thank you!

    Hi ColeWB,

    Thanks for posting your query in the Microsoft Community Forums!

    I suggest you to consult the help articles and check if it helps.

    BitLocker Drive Encryption

    http://Windows.Microsoft.com/en-us/Windows7/products/features/BitLocker

    Protect your files using BitLocker Drive encryption

    http://Windows.Microsoft.com/en-us/Windows7/help-protect-your-files-using-BitLocker-Drive-encryption

    It will be useful.

    Let us know if you encounter problems under windows in the future. We will be happy to help you.

  • SG500 showing the same MAC address on more than one port?

    My ISP has been help me solve a problem that we had with an interaction between our SG500 battery on HP customer premises equipment.

    I have the stack of SG500 divided into two VIRTUAL LANs. 8-port VLAN11 and the rest on VLAN1. Both are of VLAN native, not marked so they will carry only the traffic for their own VLAN with no mixing. I also route between these VLANs on the stack.

    VLAN11 switch ip: 10.76.20.20

    IP switch VLAN1: 10.1.1.1

    I took a port for each VLAN and plugged into the HP PSI switch, where he adapt VLANS separated which then connect to a remote data center through an MPLS.

    Here's the question: the SG500 seems to have mac address base on two HP PSI switch ports. This disrupts the HP switch, and I end up having packets to fall into a black hole. This is the output of the switch from HP showing mac based battery SG500 goods between ports in seconds:

    HP # display the address mac 8843e1-af7085

    Status and counters - Address-Table - 8843e1-af7085

    MAC address: 8843e1-af7085

    Located on the Port: 15

    HP # display the address mac 8843e1-af7085

    Status and counters - Address-Table - 8843e1-af7085

    MAC address: 8843e1-af7085
    Located on the Port: 11

    Any idea what's going on here? It's as if the SG500 uses the MAC even for both its IP addresses.

    Thank you!

    Hi Dani, the only MAC address announced by SX300/500 series should be the Mac system if you show on the SX500 mac address table, you should see the MAC even for both VLAN. I don't know why, is to confuse the HP switch unless it does not correctly between switches vlan tag.

    -Tom
    Please mark replied messages useful

Maybe you are looking for