3 Replies Latest reply on Feb 11, 2007 7:15 PM by James Newton, ACP

    hilite some of the lines in text box/field

    jetpak
      i have one text area / field with 20 lines . i need to hilite some of these lines with two diferent colors. how can i do it. when i use hilite command it always hilite with black color.
      and another question: each of these lines should link to another director movie. how to do it with lingo?
      thnk you for help..
        • 1. Re: hilite some of the lines in text box/field
          Lukewig Level 1
          Hi,

          You can set the colour of different chunks of text (such as each line), but I don't think there is a built in method of 'hilighting' non-contiguous chunks. You could do it manually by resizing and placing additional sprites over the top (which would be easier if the text didn't scroll and never changed). To simply change the color of the text, do something like this

          member("textMember").word[2].color = rgb("#123456")

          You can make lines 'clickable' by setting hyperlinks in the text. Then add a behaviour with a "on hyperlinkClicked' method to the text. If you set the 'url' of the link to your movie name, then the behaviour could be like this:

          on hyperlinkClicked(me, data, range)
          go to movie data
          end

          -- Luke
          • 2. Re: hilite some of the lines in text box/field
            jetpak Level 1
            hi luke,
            thanks a lot for yor answer!!

            my problem is that the text is scrollable, so i cannot use additional sprites.
            i am using method hilite() which can highlite as many lines as i want but only with black (default?)color. i was wondering if there is way of changing that color?
            i have it like this:

            member("myText").line[2].hilite()
            but hilite is black.. :-(
            when i put something like this: member("myText").line[2].hilite(35) ::continues black..

            And about the hyperlinks: in text i have many lines(like 30) each with link to different frame and/or different movie... how to tell to those lines/links to go where i want?

            thanks a lot
            • 3. Re: hilite some of the lines in text box/field
              James Newton, ACP Level 3
              "the text is scrollable, so i cannot use additional sprites".

              Sure you can. Here's an example of discontiguous text colouring in a scrollable sprite: http://nonlinear.openspark.com/tips/text/multiselect/. This uses a bitmap sprite in the channel above the text sprite.

              I have never had any call to use two different hilite colours, but I imagine that the example above should get you started.