Make Button load Words from List

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!!!

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

Similar Messages

  • How to find the ocuurence of a word from LIST A in LIST B in a text file?

    Hey if you look at the text file there is LIST A and LIST B.. i need to find the ocuurence of a word from LIST A in LIST B. Eg: if my output is (1,3)
    then first word from LIST A occurs in 3 places in LIST B.
    Can you please get the sample code to do this process.
    Please let me know..
    My text file looks like this below :
    phrases.txt
    LIST A
    aamsz
    abaffiliate
    aboard casino
    above computer
    above pop
    above violat
    LIST B
    http://209.153.231.131
    HTTP/1.0 200 OK
    Server: Microsoft-IIS/5.0
    Date: Mon, 02 Feb 2004 11:53:26 GMT
    IISExport: This web site was exported using IIS Export v2.2
    IISExport: This web site was exported using IIS Export v2.2
    Content-Length: 274
    Content-Type: text/html
    Set-Cookie: ASPSESSIONIDSSDBBBAR=OOGFKOJBMKMDCGPIHPADALHB; path=/
    aboard casino
    Cache-control: private
    abaffiliate
    above computer

    The key difference is that Vector is synchronized whilst ArrayList is not. Synchronized means that the classes methods can safely be accessed by different threads and as your application will not be multithreaded then the ArrayList is possibly the better option.
    To store Strings in an ArrayList, you first need to declare the ArrayList object something like this;
    ArrayList<String> listAList = new ArrayList<String>();and you would obviously do something similar for the ArrayList that will hold the Strings that should belong to List B.
    The first thing to note is that you can use the new (well new in version 1.5 anyway) generics techniques to specify the type of the object the ArrayList will hold; Strings in this case.
    To add a value into the ArrayList once you have read it from the file and decided if it belongs in the List A or List B ArrayList, all you need to do is call the add() method of the ArrayList something like this;
    // Assume that you read the line from the file into a variable called temp;
    listAList.add(temp);To compare the two lists, the easiest option would be to iterate through one ArrayList and ceheck to see if the values you recover from it are duplicated in the other ArrayList. Luckilly, ArrayList has another method that helps here, it is called contains();
    Assuming that you have two ArrayList(s), one called listAList that holds the Strings that belong to List A and another called listBList that holds the Strings that belong to ListB, you could do something like this to check for duplicates;
    for(String element : listAList) {
        if(listBList.contains(element)) {
            System.out.println("Found a match");
    }Hope that helps.

  • Selecting and copying words from list to textfield

    I am trying to copy words from a list into a text field. I want to be able to select one word at a time, from the list, and have them create a sentence in the text field ie: you build up the sentence one word at a time. I have tried to code this (See code below) but you have to select all the words in one go and then copy them, you can't copy them over individually. Also the words rearrange themselves so that they are in the same order they were in, in the list. Any help would be most appreciated.
    Thanks in advance
    Jes
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    //<applet code="MyList.class" width=400 height=300></applet>
    public class MyList extends Applet implements ActionListener {     
    private List wordList, copyList;
    private Button copy;     
    private TextField answer;     
    public MyList(){     
    public void init()     {     
    wordList = new List (5, true);
    copy = new Button ("Copy >>>");
    answer = new TextField (30);     
    copy.addActionListener(this);
    wordList.addItem("say");
    wordList.addItem("Oranges");     
    wordList.addItem("St.");     
    wordList.addItem("Lemons");     
    wordList.addItem("bells");     
    wordList.addItem("and");     
    wordList.addItem("Clements");     
    wordList.addItem("the");     
    wordList.addItem("of");
    add (wordList);          
    add (copy);          
    add (answer);     
    public void actionPerformed (ActionEvent e)     {
    String[] words = wordList.getSelectedItems();
    StringBuffer sentence = new StringBuffer();     
    for (int ii = 0; ii < words.length; ii++) {     
    sentence.append(words[ii]+" ");}          
    answer.setText(sentence.toString());     

    I'm a tad confused with your question. Do you NOT want multiple selection, or do you?

  • Dynamically fill area with words from list

    hello all,
    i would like to fill the entire area of a flash movie with
    words.
    the movie starts out blank, but as time goes on the visible
    area fills with words from a pre-written list.
    ideally, the height and width of the words is randomized
    within a range i determine.
    i wouldn't mind being pointed to a tutorial that shows how to
    fill an area with randomly-sized rectangles, that might help.
    eventually, i want to be able to control the speed of the
    area being filled with an input device (mouse or external sensor)
    but first things first!
    am using flash 8.
    thank you,
    aya.

    You may want to check this out. It fills a space with words
    and keeps filling the empty space. I'ts open source so you can take
    peak inside.
    http://www.levitated.net/daily/levEmotionFractal.html

  • How to make buttons of Strings from a db

    I have this program "SokGenre" which connects to a db and take out some Strings and put them in a vector.
    Now I would like to have an applet with Buttons and each button shall have text from one of the strings from the db.
    Any tips? How shall I do?
    How do I "link" the programs to eachother? Im a newbie....
    import java.sql.*;
    import java.util.*;
    class SokGenre {
         public static void main(String[] args) {
              Connection conn = null;
         try {
              Class.forName("org.gjt.mm.mysql.Driver");
         conn = DriverManager.getConnection( "jdbc:mysql://localhost/MyDb?user=root&password=" );
         Statement stmt = conn.createStatement();
         String query = "SELECT Gnamn FROM genre WHERE Gover='-'ORDER BY Gama";
         ResultSet rs = stmt.executeQuery(query);
         Vector vektor = new Vector();
         while (rs.next()){
                        vektor.addElement(rs.getString("Gnamn"));
              System.out.println("Vektor: "+vektor);
         catch(Exception e) {e.printStackTrace(System.err);}
         finally {
              try {conn.close();}
              catch(Exception e) {e.printStackTrace(System.err);}

    Here's some info on Applets.
    http://java.sun.com/docs/books/tutorial/applet/index.html
    You can create a Button using a String so that shouldn't be any problem. You can add Buttons to an Applet. You will have to learn about ActionListeners if you want your program to do something when a Button is clicked.
    The code you have might be included in the Applet class that you create. Or you might have a button to "Retrieve" the data from the db and clicking the button causes the ActionListener to call the SokGenre main method.

  • Make button load script?

    I have a comment form and when you hit the submit button on the form it brings you to another page wich launches a script that post's the comment.
    Is there a way for me to initiate the script when the button is pressed and not go to the new page and also reload the page my comment was submitted on?

    Sure. Just put the script that is on the other page into the first page. You will then need to submit the form page back to itself. If you don't want the page to reload, you would need to use ajax.

  • Can I set up a link (button or word) from a specific slide in a slideshow?

    Can I set up a link from a specific slide in a slideshow?

    Yes
    Turn off the "Edit Together" option.
    Navigate to the slide you want (turn thumbnails on temporarily if necessary).
    Select the area you want.
    Hyperlink in the normal way.
    Repeat until you have linked all the slides you require.
    Turn "Edit Together" back on.
    I think I had to link the caption separately as I couldn't find a way of selecting them together with the image or grouping them. Each slide links to a different page no problem.
    Peter

  • How to make a button load a sprite from library??

    PLEASE HELP!!
    Hey everyone.. iv been looking for help for a few weeks but cant seem to find the awnsers
    I am trying to create a newspaper that consists of four pages. Each   page i have created and are sitting in the library as sprites. Each page   has buttons that need linking so that when pressed it loads the next   page or page that i want. This is the part i am confused with =/ how do i   make the buttons on each page load the next page (sprite) from the   library??
    Basically i want to no how to make a button load a sprite from the library when clicked. Does anyone no the script for this?
    Thanks for any help

    A question arises as to whether or not you are posting in the right forum.  Sprites are AS3 objects.
    If you want to add movieclips to the stage from the library using AS2, then you need to assign them each an Identifier via right clicking them in the library and selecting the Linkage option... from there you slect the option to Export for Actionscript and then assign the Identifier.
    You then use the attachMovie() method to make use of that Identifier to dynamically load the library object.

  • TS3297 I recently started my apple I'd account and used my wife's bank card for payment info. I then loaded $75 from iTunes gift cards on the account. I was able to make in app purchases, now its telling me to contact iTunes Store support to complete now?

    I recently started my apple I'd account and used my wife's bank card for payment info. I then loaded $75 from iTunes gift cards on the account. I was able to make in app purchases, now its telling me to contact iTunes Store support to complete now? Help

    Do what it told you to do.
    Contact itunes support
    http://www.apple.com/support/itunes/contact/

  • Choose from List-CFL button is not visible

    Hi Experts,
    I am using SAP B1 8.8 PL 05 in ramp up. I have observed that in some of the clients PCs in Sales Order window I am not able to see the Choose from list button / CFL button for selecting Customer Or say Item.
    This happens only in some Client PCs, where as in other clients PCs it works fine.
    BR
    Samir Gandhi

    Hi Rashid,
    I did that. Now the indicator is displayed, but still I am not able to see the customer / item  list.
    BR
    Samir Gandhi

  • Setting button property after selecting data from list

    I am not able to set the button property after selecting data from list.
    I would like to say that
    * If a user select an item from list, then user is only allowed to update or delete the data. The update and delete button should be enabled and save button should be disabled.
    * If the users types data manually, then user is allowed only to save this as new entry. The update or delete button at this time should be disabled and only save button should be enabled.
    I want to say that
    In both case, value will be there
    In one case, value will be from list and that is available for update or delete
    in another case, value will be typed from keyboard that is available for save(new entry).
    I do not want to use separate form for update/delete/save new record. I want to use single form for all these operations.
    I am using Form 6i and oracle 8
    Please guide me, I am trying to find this answer for last four days, but could not find the answer. Please help me. Waiting for you reply...

    Thanks Mr. fdellipriscoli,
    But where should this code be written and
    Where the parameter be set to 'YES'
    I think this code should be written somewhere when calling list.
    But bydefault list is called by pressing F9 key. Then where the parameter be set to 'YES' .
    Please help Mr. fdellipriscoli. Waiting for your reply...

  • Make a bus card from scratch in MS word: mac

    This might not be the right place to post this, but here goes....
    I installed MS office 2008 on my mac, and wanted to create a business card in word... but its proving to be more difficult than I thought. The only way I knew how to start was with a template under the publishing elements. There are only three designs, none of which I want, so I started with the template and tried to change the background, etc., but that's easier said than done.
    I ended up just pasting a new background over the old in the first business card slot, but the others did not follow. When I've done this with other software, there's a basic blank template for bus cards that you can customize easily, with formatting options like "add background," which when utilized are replicated on every business card in the document. Why is this version of word making this task so tricky? I hope its just me, and there is an easy way to do this....
    How can I make a bus card from scratch, add my own design, etc.?
    Thanks for taking the time to read this,
    Marilyn

    *"This might not be the right place to post this, "*
    Correct. This forum is for troubleshooting Apple Software Update for Windows, a software package for Windows designed to update Apple products that run on Windows, and completely unrelated to Microsoft Office. You'd be better off posting your question on Microsoft's own forum for their Mac products:
    http://www.officeformac.com/productforums

  • Choose From List Cancel Button Throws Exception

    Hi all,
    When I click the "Cancel" Button on my CFL, I get an error....
    EXCEPTION: Matrix__EBS_FRM_CRDCLM__64.OnAfterChooseFromList raised
    No matching records found (ODBC -2028)
    Any ideas???

    Hi
    in your choose from list  event add this  condition
    If Not pval.SelectedObjects Is Nothing Then
    'write your code in this if condition
    end if
    hope it will help u.
    Regards,
    Mithun.

  • I am wanting to import photos  from my imac to my ipad.  the help page directed me to open the photo button under the device listing on itunes.  There is not a photo button and I am connected to the computer.  It does show buttons for books, movies, etc.

    I want to import photos from iphoto to my ipad.  The help button said to press the photo button under the device list.  There isn't a photo button shown.  Could it be hidden?

    If you connect and select your iPad on the left-hand side of your computer's iTunes, on the right-hand side of iTunes (not on the left) there should be a series of tabs, one of which should be Photos - if you select that tab you can then select which photo folders or albums/events to sync to the iPad. There is a bit more info on this page. You will need to sync all the photos that you want on the iPad together in one go as only the most recent photo sync remains on the iPad - synced photos can't be deleted directly on the iPad, instead they are deleted by not including them in the next photo sync.

  • I need to make button which made a spool from my oracle forms 2.1

    i need to make button which made a spool from my oracle forms 2.1
    how can i do that
    thanks alot

    Wow, you just said the same thing. First, when you say "Forms 2.1" do you mean "Developer 2.1", which included Forms 5.0? Regardless, are you aware that these Forms versions are about 15 or more years old?
    What you are trying to do is still unclear. Are you trying to output records to a text file formated to csv? If you need assistance, please provide some clarification as to what you are trying to accomplish.

Maybe you are looking for

  • Convert catalog from PSE 6 to 10, is it necessary to include the jpegs?

    Hello I am testing PSE 10 (from PSE 6) and have copied the catalog to a test XP box (but not the jpegs).  The catalog refuses to convert with an unspecic error: "Catalog conversion failed" see "Catalog Conversion Errors" for more details. PSE 6 can f

  • F110 - KG and KR at the same time?

    Hi Gurus. I have made a proposal of payments with Tx. F110 for one vendor. This one has two open items: 1KG and 1KR, the 2 items are not overdue, but the payment proposal only includes the amount of my bill (KR). The F110 includes all routes of payme

  • LOAD_PROGRAM_NOT_FOUND

    Hi, In My XI system I get every hour message below (DDIC user , 000 Client) I search sap notes but did not find proper note. Is there anyone to help me? Thanks Runtime Error          <b>LOAD_PROGRAM_NOT_FOUND</b> Date and Time          06.12.2007 09:

  • Authorization of Report Painter GRR3

    Dear Kindly help me to restrict our users on Tcode GRR3 for Report Painter. There are number of reports under Report >>> Library. on authorization at PFCG I created a role and has only one tcode GRR3. under this there are four objects Report Writer:

  • 2007A B1 MANUAL A/R INVOICE PROBLEM

    We recently implemented B1 version 2007A from 2005 and in the process manually entered several A/R Invoices as Service Invoices since we were unable to copy over during the upgrade.  I am currently trying to write a query to detail open A/R invoices