Results 1 to 7 of 7

Thread: Easy but newbie as me can't do it :(

  1. #1
    Senior Member
    Join Date
    Oct 2004
    Posts
    187

    Easy but newbie as me can't do it :(

    Hello!
    I have to create a web page for the element Zn.
    I have all the necessary info to do it, but one problem is not solved in my mind. The teacher wants that there is a page where the user can test his knowleges. And as i know only a little actionscript I will try to make the page with flash.
    He is what I don't know how to do.
    If I have an equation for exemple:ZnCl2 + NaOH -> (here I want that the user give the right answer).
    What script must I use for that?
    I remember a lesson in Flash ActionScript book for entering different information and then to check if it correct. The problem is that this information was only numbers. What I must do that the script check only if the information entered is equal to what it must be?
    Hope you understood what I meen. Please give me a clue!
    Thanks in advance!!!
    Remember, all I\'m offering is the truth, nothing more.

  2. #2
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    I know next to nothing about chemistry... and nothing about ActionScript.

    I'm guessing the answer would be some characters (in the right order)?
    This is usually called a string. You probably need to use some string comparing functions.
    Most, if not all, programming languages have functions to handle strings.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  3. #3
    Senior Member
    Join Date
    Mar 2005
    Posts
    175
    How about using the flag values for each compound and pre-defining what elements can combine and what will they form. Hope you got my point.

    and am I correct? - ZnCl2 + 2NaOH --> 2NaCl + Zn(OH)2
    \"And life is what we make it. Always has been, always will be.\"

  4. #4
    Senior Member
    Join Date
    Oct 2004
    Posts
    187
    Thank you for the suggestion. I did the same way.
    You have ZnCl2 + 2NaOh --> box for the text called zinc + box for the number + box called Zn(OH) and a button check answer.
    Here is the code:

    on (release){
    if (zink.text == "Zn(OH)2", number.text == "2", Zn(OH).text == "NaCl"){
    trace ("you are right!");
    }else{
    trace("you are wrong!")
    }
    }

    It is working nice!
    Remember, all I\'m offering is the truth, nothing more.

  5. #5
    Senior Member
    Join Date
    Mar 2005
    Posts
    175
    Congratulations!

    Is your test based basically on balacing the equation or getting the products formed?
    coz the whole program would be differ in either case.

    Cheer!!
    \"And life is what we make it. Always has been, always will be.\"

  6. #6
    Senior Member
    Join Date
    Oct 2004
    Posts
    187
    I'm not sure I understand your question.
    The test is based on getting the products formed and then balancing the equation .

    Do you know how can I make a note to display after the user finish the test?
    Remember, all I\'m offering is the truth, nothing more.

  7. #7
    Senior Member
    Join Date
    Mar 2005
    Posts
    175
    Do you know how can I make a note to display after the user finish the test?
    You mean you want to display the result. Well, again use flags as when user get the answer correct add 1 to some var and for wrongs answers to some other var.

    I think somebody had already made an app very much similar to this at Flash Kit. I hope that would help you.

    - :S:
    \"And life is what we make it. Always has been, always will be.\"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •