PDA

View Full Version : how to solve this input text problem??


veryverygut
05-11-2009, 03:15 PM
i'm a flash beginner (still in flash 8). i've encountered a input text problem which maybe very simple to you guys.

here's what i'm trying to do:

to let player type in three characters (input text), which will be then rearranged in a preset format again in the next line.

for example:

please type in:

A, B, C

then it'll show in the next line like:

C ,A, B

can anyone help me on this? really appreciate!!

Aloseous
05-11-2009, 03:47 PM
var temp:Array = new Array();
var mystr:String;
var ind:Number;
_btn.onRelease = function() {
mystr = "";
temp = inp_txt.text.split("");
while (temp.length>0) {
ind = random(temp.length);
mystr += temp[ind];
temp.splice(ind,1);
}
out_txt.text = mystr;
};

veryverygut
05-12-2009, 04:22 PM
thx alot!