Random letters in random places within and around a string

This will be very confusing to explain so i will use a few examples along the way to describe what i am trying to do.

So first: I saw a game on GSN called “Camouflage”. If any of you have seen it, great, that’s what i want to make. If not: There are phrases hidden in a sea of text and slowly one by one the letters not included in the phrase are taken away to reveal the final phrase. You ring in to guess at what the phrase is.

Example:

[FONT=Courier New]K W R I R O K U D P A S

Next round:

[/FONT][FONT=Courier New]K R **I R **O K U D P A S

Next round:

[/FONT][FONT=Courier New]K W R **I R **O K U D P A

And it continues until only KIRUPA is left.

About every second and a half a letter not included in the phrase is taken away and the amount of points you win goes down by 10.

I have the basic game mechanics down as well as a random letter generator, but i do not know how to randomly place random letters in a string and how to make them go away after a period of time.

Here is what i have so far:

The game mechanics: http://www.davidzych.com/marc/camouflage.swf

(Click start to get it going, then click answer to stop the clock then type in the word in the middle of the screen then click on the box to the right. Repeat to go again.)

And the random letter generator: http://www.davidzych.com/marc/randomLetterTest.swf
(click on the black box to generate random letters)

And the source code for each:

Note: I’m making it in Flash CS3 and i was too lazy to create the text fields and boxes with AS so i didn’t. Also i couldnt’ think of good names for functions.
Camouflage:
[/FONT]

stop();

var totalScoreNumber:Number = 0;
totalScore.text = "0";
var countDown:Timer = new Timer(1300, 999);
var countDown2:Timer = new Timer(1000, 999);
var scoreNumber:Number = 100;
var timeLeft:Number = 5;
score.text = scoreNumber.toString();
start_btn.buttonMode = true;
start_btn.addEventListener(MouseEvent.CLICK, startTimer);
countDown.addEventListener(TimerEvent.TIMER, restartLose);
countDown2.addEventListener(TimerEvent.TIMER, restartLose2);
stage.addEventListener(Event.ENTER_FRAME, timerCheck);

function timerCheck(event:Event):void
{
    if(scoreNumber == 0)
    {
        response_txt.text = "Out of time!";
        submit_btn.removeEventListener(MouseEvent.CLICK, answer);
        start_btn.addEventListener(MouseEvent.CLICK, startTimer);
        countDown.stop();
        start_btn.buttonMode = true;
        submit_btn.buttonMode = false;
        answer_btn.buttonMode = false;
    }
    else if(timeLeft == 0)
    {
        response_txt.text = "Out of time!";
        submit_btn.removeEventListener(MouseEvent.CLICK, answer);
        start_btn.addEventListener(MouseEvent.CLICK, startTimer);
        countDown2.stop();
        start_btn.buttonMode = true;
        submit_btn.buttonMode = false;
    }
}

function startTimer(event:MouseEvent):void
{
    start_btn.buttonMode = false;
    answer_btn.buttonMode = true;
    timeNumber.text = "";
    response_txt.text = "";
    answer_txt.text = "";
    countDown.start();
    scoreNumber = 100;
    score.text = scoreNumber.toString();
    answerNumber = Math.floor(Math.random() * answers.length);
    hint_txt.text = hints[answerNumber];
    answer_btn.addEventListener(MouseEvent.CLICK, stopTimer);
    start_btn.removeEventListener(MouseEvent.CLICK, startTimer);
}

function stopTimer(event:MouseEvent):void
{
    countDown.stop();
    countDown2.start();
    timeLeft = 5;
    submit_btn.buttonMode = true;
    answer_btn.buttonMode = false;
    timeNumber.text = timeLeft.toString();
    submit_btn.addEventListener(MouseEvent.CLICK, answer);
    answer_btn.removeEventListener(MouseEvent.CLICK, stopTimer);
}

function restartLose(event:TimerEvent):void
{
    scoreNumber -= 10;
    score.text = scoreNumber.toString();
}

function restartLose2(event:TimerEvent):void
{
    timeLeft -= 1;
    timeNumber.text = timeLeft.toString();
}


var answers:Array = ["yes", "no", "maybe", "not", "pirate", "adobe", "macromedia", "flash"];
var hints:Array = ["yes", "no", "maybe", "not", "pirate", "adobe", "macromedia", "flash"];
var answerNumber:Number = Math.floor(Math.random() * answers.length);
function answer(event:MouseEvent):void
{
    start_btn.buttonMode = true;
    submit_btn.buttonMode = false;
    countDown2.stop();
    submit_btn.removeEventListener(MouseEvent.CLICK, answer);
    start_btn.addEventListener(MouseEvent.CLICK, startTimer);
    if(answer_txt.text == answers[answerNumber])
    {
        response_txt.text = "Correct!";
        totalScoreNumber += scoreNumber;
        totalScore.text = totalScoreNumber.toString();
    }
    else
    {
        response_txt.text = "Incorrect!";
    }
}

Random letter:

var letter1:Number = 0;
var letter2:Number = 0;
var letter3:Number = 0;
var letter4:Number = 0;
var letter5:Number = 0;
var letter6:Number = 0;
var letter7:Number = 0;
var letter8:Number = 0;

var letters:Array = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];

button_btn.buttonMode = true;
button_btn.addEventListener(MouseEvent.CLICK, randomLetterFix);

function randomLetterFix(event:MouseEvent):void
{
    letter_txt.text = "";
    randomLetter();
}

function randomLetter()
{
    letter1 = Math.floor(Math.random() * 26);
    letter2 = Math.floor(Math.random() * 26);
    letter3 = Math.floor(Math.random() * 26);
    letter4 = Math.floor(Math.random() * 26);
    letter5 = Math.floor(Math.random() * 26);
    letter6 = Math.floor(Math.random() * 26);
    letter7 = Math.floor(Math.random() * 26);
    letter8 = Math.floor(Math.random() * 26);
    letter_txt.text = letters[letter1] + letters[letter2] + letters[letter3] + letters[letter4] + letters[letter5] + letters[letter6] + letters[letter7] + letters[letter8];
}

So i have an array of phrases that i want hidden dispersed in other random letters and i want the random letters not a part of the phrase to disappear when i run a function.

Sorry that this was a lot of reading and explanation but i figure that i’d over explain it so there isn’t any confusion.

Again - The .swfs i have right now work GREAT! It’s just the randomly dispersing the phrases that i don’t know how to do along with taking these letters away.