Joined: November 3rd, 2004, 6:44 pm Posts: 59 Location: Ipswich, UK
|
Hi,
I have a problem with using replaceselection in a function. Everything works fine ( I have checked by substituting the lettervariable and letter[loop]) until I want to update a particular text object using the "lettervariable" as seen below.
I have used something similar before but, as is always the case, I can't now find it!
============================================
function CheckLetter(LetterPressed)
{
for (Loop = 1;Loop < letter.length +1;Loop ++)
{
if (LetterPressed == letter[Loop])
{
var lettervariable = "letter" + Loop
eval(lettervariable)
CheckLetter1 = lettervariable // checks variable works
lettervariable.SetSelection(0,-1)
lettervariable.ReplaceSelection(letter[Loop])
}
}
}
============================================
The function should iterate through to check to see if a particular letter (letterpressed) is found within the characters in a word (previously read into an array).
There is probably something obvious that too much Christmas spirit has made me overlook, so any help would be appreciated.
Regards
Clive Cartmel
For this message Clive Cartmel has been thanked by : mackavi
|
|