A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: random loading text

  1. #1
    I have a site where I'd like to display random lines from a text file. I know on how to load from a text file but not how to randomly select lines from that text file. Is any of this making sense? Please help me. =/

  2. #2
    Join Date
    Oct 2000
    whe you load all your variables into an array u can use a randomize method...

    function randomizeArray(anArray){ 
    var returnArray = new Array(); 
    while (anArray.length > 0) { 
    // set a random index 
    var index = random(anArray.length); 
    // append the term corresponding with the index into the return array 
    // remove the term corresponding with the index from the passed array 
    anArray.splice(index, 1); 
    return returnArray; 
    then you can make you'r lines simply and random

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