Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

highlight keyword search results

Status
Not open for further replies.

tracytcb

Technical User
Mar 18, 2003
11
GB
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.

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'.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top