A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: ::: an array of messages :::

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Posts
    473

    ::: an array of messages :::

    im wanting to display random messages on screen

    i want to create an array of 10 messages that randomly changes every 10 seconds

    where do i start



  2. #2
    immoralator
    Join Date
    Dec 2001
    Location
    UK
    Posts
    270
    This creates a textfield and every 10 seconds drops a random quote from the array of quotes I've made.
    code:
    this.createTextField ("textBox", 0, 0, 0, 250, 20);
    names = new Array ("I am a fish", "where are the shoes?", "the dog has a nasty bite", "there's sand in my shoes!", "BURNINATION!!");
    message = setInterval (changeMsg, 10000, Math.floor (Math.random () * names.length));
    function changeMsg (randomNum) {
    textBox.text = names[randomNum];
    }


Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center