Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default [ACTIONSCRIPT]: quick question

    i have this sort of quiz thing with multiple choise.

    when you click one of the 3 choices i have a code:
    Code:
    resultaat1 = "juist";
    meaning result = "correct"; but in dutch.

    now to do something later on with it, i need to check the awsners of all my questions so i have this on the top frame:

    function bereken(){
    if(resultaat1 == "juist" && resultaat2 == "juist"){
    do something
    }
    }
    is this correct ? should i use && or || ?

    anyway all i know is, it's not working for me :p

  2. #2
    Join Date
    Jun 2006
    Location
    Manchester
    Posts
    56
    Tokens
    0

    Default

    Ok I have never worked with Actionscript, but I have worked with a few other languages so just a few questions. Have you defined resultaat2? because if you haven't that could be why it's not working. I'm not sure of the operators in Actionscript. You could perhaps also try

    Code:
    function bereken(){
     if(resultaat1 == "juist"){
      do something
      if(resultaat2 == "juist") {
       do something
      }
     }
    }
    I have no idea if you can incase another IF statement into another one, but you can in VB which is one of the languages I use a lot.

    If not just try messing around with the && or == operators or something, because I have no idea about AS. You may have to mess around with else statements if AS use them as well, but I don't know.
    Last edited by Net-Margin; 07-10-2007 at 09:33 PM.

  3. #3
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default

    Thanks for helping but that wont work.

    As I need all awnsers to be correct at the same time.
    I have 10 questions so its like;

    Code:
    function bereken(){
    if(vraag1 == "juist" && vraag2 == "juist" && vraag3 == "juist" && vraag4 == "juist" && vraag5 == "juist" && vraag6 == "juist" && vraag7 == "juist" && vraag8 == "juist" && vraag9 == "juist" && vraag10 == "juist"){
    punten = 10;
    
    }else if(vraag1 == "juist" && vraag2 == "juist" && vraag3 == "juist" && vraag4 == "juist" && vraag5 == "juist" && vraag6 == "juist" && vraag7 == "juist" && vraag8 == "juist" && vraag9 == "juist" && vraag10 == "fout"){
    punten = 9;
    & this goes on untill they all say "fout" meaning "incorrect"
    & punten = 9; means graids = 9;

    so i have a dynamic text field with varname: punten & nexto it a static text field saying /10

    so if one would be "fout" / "incorrect" it should state 9/10 get me ?
    Last edited by [Oli]; 07-10-2007 at 09:56 PM.

Posting Permissions

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