This behavior uses a small shape for hiliting lines in a field. It also generates a property list with the line number and the text of the lines. The line text is returned on a mouseUp event.
on getBehaviorDescription
set description = ¬
"This behavior uses a small shape for hiliting lines in a field. ¬
It also generates a property list with the line number and the text of the lines. ¬
The line text is returned on a mouseUp event." & RETURN & RETURN &¬
¬
"Create a small shape cast member and drop in a score channel higher then ¬
the field sprite channel. While selected, go to Modify --> Tweak and ¬
enter -1000 in the horisontal field. This will put the sprite a thousand pixels outside¬
the stage. When the mouse is over the field, the shape sprite used for hilite, will ¬
appear over the line under the mouse, and return off stage when the mouse ¬
leaves the field." & RETURN & RETURN &¬
¬
"Then drop this behavior on the field on stage and enter the color, ink and blend values, ¬
used to set the hilite mode. Default is a pale yellow color. Use it as a starter."
pLineIndexList = [:]
repeat with i = 1 to pNumLines
pLineIndexList["Line" & i] = member(pFieldMemberNum).line[i]
end repeat
end
on mouseEnter me
if the mouseLine > 0 then
sprite(pHiliteSpriteNum).rect = pHiliteRect
end if
end
on mouseWithin me
if the mouseLine > 0 then
pCurrentLine = the mouseLine
vLineLoc = pTopSideField + (pLineHeight * (pCurrentLine - 1))
newLoc = point(pLeftSideField, vLineLoc)
sprite(pHiliteSpriteNum).loc = newLoc
updateStage
end if
end
on mouseLeave me
sprite(pHiliteSpriteNum).locH = - 1000
end
on mouseUp me
getThisLine = "Line" & pCurrentLine
put pLineIndexList[getThisLine]
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA