Skip navigation
Currently Being Moderated

Make Button load Words from List

Mar 26, 2013 6:54 PM

Tags: #file #help #flash #text #button #buttons #flash_professional #select #where #random #cs6 #when #who #what #why

Hey Guys!!!


Just a note, I dont know about proramming and I am new to flash so please say you responses in the simplest way possible, thankyou!

So I am making an app that when you click a button it will randomly select a Who, What, When, Where, and Why from a list that I make.

 

So say there is a button that says New Idea.

 

When I click the button there is:

 

Who:

 

What:

 

When:

 

Where:

 

Why:

 

Say a small list of who is 1, 2, and 3

A small list of what is 4, 5, and 6

A small list of when is 7, 8, and 9

A small list of where is 10, 11, 12

And a small list og why is 13, 14, and 15

 

How can I make it so when I click the New Idea Button it will select (by random) a who, what, when, where, and why from their lists?

 

Please help me saying what to do from making the button make get a word from a list, to what I am asking!

 

Please!!!

 

Thankyou!!!

 
Replies
  • Currently Being Moderated
    Mar 27, 2013 4:22 AM   in reply to xXZoloXx

    To make a random selection from a list you first have to have the list.  An array makes a good list, so for each category create an array and fill each with whichever choices you intend.

     

    To randomly pick one of the items in the list you can use the Math methods that Actionscript is supported by.

     

    var whoList:Array = [1,2,3];

     

    var randomWho = whoList[Math.floor(Math.random()*whoList.length)];

     

     

    Please don't start new postings for the same topic

     
    |
    Mark as:

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