1 Reply Latest reply on Jun 16, 2006 4:04 PM by neil manuell

    Highlight Input Text

    majonsey
      Hey all,
      I am building an online test with flash (mx2004) as a platform and heres what I need to do. I need to have an input text box where the student can type in a sentence, and highlight parts of the sentence (nouns verbs etc) in different colors. This needs to be sent via php page to a database so the instructor can tell what what student highlighted. Any ideas? I am a moderate actionscripter, but this is beyond me.

      Thanks in advance...
        • 1. Re: Highlight Input Text
          neil manuell Level 1
          if the text is static (and I suggest that it will have to be to do this) then you can get a TextSnapshot Object, which will enable you to interigate the corner points of each letter as will as the index positions.

          I imagine that the user would hightlight the text, then press a button (noun, advert etc) you could then get the selected text start and end indexes, get the textRunInfo for that selection, which you could use to draw a rectangle around the text. at the same time you could push the text selected onto an nounArray or adverbArray and send that off with their positions (because words could be repeated)