views:

70

answers:

2

What are the different options available for implementing a text search in an AIR HTML control? I could think of the following two:

  1. Implement by injecting a custom javascript - the downside is the script may interfere with ones already loaded with page
  2. Implement an HTML scrapper and then parse this text in Actionscript, and then using javascript highlight it.

Thoughts are most welcome.

A: 

here's a start: Using HTML in Flex-based Adobe AIR Applications. there's a section on calling javascript.

Renaud
The question is which approach between Javascript and Actionscript is better.
Sandy
A: 

The best way to perform text search in an HTML control via actionscript is to look for text nodes, extract them, perform a match, and then break the text node into 3 separate nodes: 1. The text node with part before 2. A new highlighted node with search term 3. The text node with the part after.

Sandy

related questions