A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Variables/random/repeating????

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    i need to be able to call a text file with x-amount (probably about 100) of variables in like:

    &variable1=blahblahblah
    &variable2=yacketyschmakety
    etc etc

    No probs so far... then what I need to do is to be able to use these variable by chosing five or six at random and tranfering them to named buttons with out any of them repeating...

    Is this possible, am i wasting my time?
    Yours in dire need of assistance
    The Bombadier

  2. #2
    Senior Member
    Join Date
    Dec 2000
    Posts
    215
    Hi,
    Create an array with your variable using split function if your variable arrive in the flash movie as string or within a loop which adds each of the variables up to an array.
    Then in a loop, set variable VAR a random number between 1 and the length of your array.
    Pick up the variable at the VAR index of your array and then remove it from that array if you don' t want it to come out again.
    It is possible and that just a way to do it.

  3. #3
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    Hi Alex,
    I'm pretty new to all this coding malarky, but I think I get the jist of your reply. I'll look into this split array thingy...
    Cheers
    Bombadier

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