Text field with condition in Adobe Flash

Posted on 2012-08-25
Last Modified: 2012-10-14

I need to code a simple piece of script in Adobe Flash which detects user input in a text field (single line), compares it with words in a list (14 words in total), and if there is a match it will reveal a single letter associated with that word. It's a kind of word game.

You can see the user interface in this file (Flash CS5):

Some sample words:
SUN = letter Y
MOON = letter N
SCHOOL = letter T

Question by:kenazor
    LVL 39

    Accepted Solution

    The easiest thing to do would be use an event listener and check the change event to see what is typed into your text field. This is assuming you're not just using a button in which case just use a click event.

    Then store the answers and the associated answer in 2 separate arrays. Use a for loop to loop through and check the text field contents, when you have a match break out of the for loop, get the current index in your loop and pull the answer out of the other array and display it.
    LVL 37

    Expert Comment

    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now