have the following text on text members (with thanks to MediaMacros) so that words in the text are highlighted by changing their color once found by a search engine.
This highlights occurrences of individual words from the keywords input by the user. However I want it to highlight just a phrase if the user selects to search by an exact phrase.
Question History
Comment from Tracytcb
03/18/2003 12:46AM PST
Also, the code above highlights a word which contains the keyword. eg. If the keyword is 'process' it will highlight 'processes'.
Code:
property spriteNum
on beginSprite me
m=sprite(spriteNum).member
m.color=rgb(0,0,119)
t=member("temp").text
repeat with x=1 to m.word.count
repeat with y=1 to t.word.count
if m.word[x] contains t.word[y] then
m.word[x].color=rgb(0,150,255)
end if
end repeat
end repeat
end
This highlights occurrences of individual words from the keywords input by the user. However I want it to highlight just a phrase if the user selects to search by an exact phrase.
Question History
Comment from Tracytcb
03/18/2003 12:46AM PST
Also, the code above highlights a word which contains the keyword. eg. If the keyword is 'process' it will highlight 'processes'.