change a word's color & highlight on mouseUp

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default change a word's color & highlight on mouseUp

    I have a list of names going into a field. I want a line to change color if
    I click on it. Then change back if I click on another name. Can I also have
    the line hightlight as I rollover it?

    Can this be done on a text sprite as well?

    Thanks SHane


    Shane Guest

  2. Similar Questions and Discussions

    1. Selected Text - highlight color is invisible
      I'm having some trouble with Illustrator 10 .. the document in question has a white background and black text. Normally when I select text with the...
    2. Direct To Stage ON/OFF - highlight property change
      Hi, sorry for my very very poor english. I need grabbing 3D scene to image. If use alternative "3D member to image" highlight property on...
    3. Word's Acrobat icons are gone
      Recently I was converting a large Word document (400+ pages) to PDF, and Word went brain-dead, eventually forcing me to kill it. Afterwards, the...
    4. tab highlight color
      In Flash MX 2004 Pro, is there a way to change the tab highlight on components such as textInput? I can set the tab order, but I've been unable...
    5. Highlight Color of Text
      How do I change the color that text is highlighted with when a Text Sprite is selected or tabbed to. At the moment I get a really ugly green and I'd...
  3. #2

    Default Re: change a word's color & highlight on mouseUp

    It's fairly easy on a field an a bit more complicated but doable on a text
    member

    For a field:

    But the idea is to use two properties in a behavior. One remembers the line
    rolled over and one remembers the clicked line.

    When you rollover a line you set the old line back to the original color
    (unless it equals the last clicked line, then you do nothing) and set the
    new line equal to the color you've chosen for the rollover.

    When you click on a line, you set the last clicked line back to the original
    color and set the new line that was clicked to the color you've chosen for
    the selected state. Use the mouseLine in both cases to determine what line
    is under the mouse at any point in time.

    Use the same concept for a text member but you would use locVtoLinePos () to
    determine the line under the mouse.


    Craig Wollman
    Word of Mouth Productions
    phone 212 724 8302
    fax 212 724 8151
    [url]www.wordofmouthpros.com[/url]


    "Shane" <shoffa@firstgencom.com> wrote in message
    news:bnpb4m$c68$1@forums.macromedia.com...
    > I have a list of names going into a field. I want a line to change color
    if
    > I click on it. Then change back if I click on another name. Can I also
    have
    > the line hightlight as I rollover it?
    >
    > Can this be done on a text sprite as well?
    >
    > Thanks SHane
    >
    >

    Word of Mouth Productions Guest

  4. #3

    Default Re: change a word's color & highlight on mouseUp

    Here's the code for a field. Of course, you'd put whatever other code you
    want executed in the on mouseDown handler. You could also change the
    mouseDown to a mouseUp but you'd then have to add the mouseUpOutside handler
    and reset things back to the lastclicked state if the user lets go outside
    the field. I used black as the normal state, red as rollover and yellow as
    down. Change the color numbers as you wish


    property pS, spriteNum, pName, pLastRoll, pLastClick

    on beginSprite me
    pS = sprite (spriteNum)
    pName = pS.member.name
    pLastRoll = 0
    pLastClick = 0
    end

    on mouseDown me
    if the mouseLine <> pLastClick then
    the foreColor of line pLastClick of field (pName) = 255
    pLastClick = the mouseline
    the foreColor of line pLastClick of field (pName) = 4
    end if
    end

    on mouseEnter me
    cursor 280
    if the mouseLine <> pLastClick then
    if pLastRoll <> pLastClick then
    the foreColor of line pLastRoll of field (pName) = 255
    end if
    pLastRoll = the mouseline
    the foreColor of line pLastRoll of field (pName) = 6
    end if
    end

    on mouseWithin me
    if the mouseLine <> pLastRoll then
    if pLastRoll <> pLastClick then
    the foreColor of line pLastRoll of field (pName) = 255
    end if
    pLastRoll = the mouseline
    if pLastRoll <> pLastClick then
    the foreColor of line pLastRoll of field (pName) = 6
    end if
    end if
    end

    on mouseLeave me
    cursor -1
    if pLastRoll <> pLastClick then
    the foreColor of line pLastRoll of field (pName) = 255
    end if
    end



    --
    Craig Wollman
    Word of Mouth Productions
    phone 212 724 8302
    fax 212 724 8151
    [url]www.wordofmouthpros.com[/url]


    "Shane" <shoffa@firstgencom.com> wrote in message
    news:bnpb4m$c68$1@forums.macromedia.com...
    > I have a list of names going into a field. I want a line to change color
    if
    > I click on it. Then change back if I click on another name. Can I also
    have
    > the line hightlight as I rollover it?
    >
    > Can this be done on a text sprite as well?
    >
    > Thanks SHane
    >
    >

    Word of Mouth Productions Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139