Skip navigation
JRGT403
Currently Being Moderated

Coding for random answers

Sep 1, 2013 2:00 PM

I'm working on my first project with FB, I can't figure out how to code for the answers to user given questions to be generated at random,  ie: "The answer is YES / NO / Maybe"

 

 

This is what I have so far for that part of it.

 

<fx:Script>

                    <![CDATA[

                              function displayAnswer()

                              {

                                        var object:Object = new Object();

                                        object.a = " Yes"

                                        object.b = " No"

                                        object.c = " Maybe"

                                                  lblAnswer.text="The Answer is"+object.c  //I can generate the ansewr i want with this but how do i randomize between objects "a-c"

                              }

                    ]]>

</fx:Script>

 

 

please let me know if I'm going about this all wrong, I'm using FB 4.6 this is an Air build

 

Thanks

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points