Is it possible to replace words with imagesource based upon user input?

William de Smet wdesmet at wanadoo.nl
Sat Sep 16 07:07:38 EDT 2006


Hi there,

Here's a nice one. I'd like to replace chars with imagesource based
upon user input and so far I came up with this:
on mouseUp
  Ask "Write a sentence:"
  put it into fld "text"
  if the text of fld "text" contains "school"
  then replace "school" with "Q" in fld "text"
  then set the imagesource of the last char of fld "text" to 1009
  end if
end mouseUp

As you can see there is a problem with this script:
- always the last char is replaced with the imagesource even if there
are three words in the sentence. It only works when you put just one
word into it and that word is "school".

I know I have to make a statement for every word the user puts into
the sentence.
I don't know you to combine it.
Is it possible to replace a whole word with an imagesource?

Who has a good idea?

greetings,

William de Smet



More information about the Use-livecode mailing list