Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

+ Reply to Thread
Results 1 to 3 of 3
  1. #1

    Default AS2 If/Else and condition confusion

    I'm using Flash Pro 8, and I'm trying to help some students study for a class that, I'm told, the premed students at their university take elsewhere because this professor is too hard.

    What I've done so far is create a series of buttons (1-15), which when pressed displays Q1-15 in a dynamic text box (questionnumber). I'd like for them to be able to type in the corresponding answer in to the input text box (answer) and be told whether or not it was correct in a second dynamic text box (comment).

    I'm having several problems, most certainly coming from my misunderstanding of probably everything.

    Right now, any answer is shown as incorrect, and removing else comment = "Incorrect" gets no result.

    submitbutton

    Code:
    on (release, keyPress "<Enter>")
    {
         if ((questionnumber == "Q1") && (answer == "premaxilla"))
         {
              comment = "Correct!";
         }
         else if ((questionnumber == "Q2") && (answer == "nasal"))
         {
              comment = "Correct!";
         }
         else if ((questionnumber == "Q3") && (answer == "lacrimal"))
         {
              comment = "Correct!";
         }
         else
         {
              comment = "Incorrect";
         }
    }
    Last edited by Vlykarye; 09-23-2011 at 09:40 PM.

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2

    Default

    Thanks for the edit, forgot the code tags -_- I feel like I'm just forgetting something really basic here too

  4. #3
    Join Date
    Jun 2009
    Location
    Houston, Tx
    Posts
    485

    Default

    Hmm.. I thought I posted a reply. But I guess not. What exactly did you want here?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial