>I want to be able to change the characters in a given textfeild randomly?
>Like a scrabbled word?
>
>Thanks..
>
>Elvin M. Certeza, Jr.
>http://www.alphalink.com.au/~certeza/


Here's a bhv that changes the text randomly.

Define a string that contains all the characters you think should be 
allowed. Randomize a number between (1 and the length of the string). 
Get the corresponding character from the string, put it at the end of 
the new text. Repeat as long as the new text is shorter that the old 
text.

Is this what you mean?


-A.


------------------------------------

on mouseDown me

   approvedChars = "abcdefghijklmnopqrstuvwxyz0123456789"
   newText = ""

   repeat with charNr = 1 to sprite(me.spriteNum).member.text.length

     randomCharIndex = random(approvedChars.length)
     newChar = approvedChars.char[randomCharIndex]
     put newChar after newText

   end repeat

   sprite(me.spriteNum).member.text = newText
end

------------------------------------


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to