Quantcast
Channel: Adobe Community : Discussion List - Using Flash Builder
Viewing all articles
Browse latest Browse all 1802

Coding for random answers

$
0
0

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


Viewing all articles
Browse latest Browse all 1802

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>