on getBehaviorDescription
return "This applies to the text or field sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings text interactivity by line."
end
on isOKtoAttach me, spriteType, spriteNum
case spriteType of
#graphic:
meType = sprite(spriteNum).member.type
return meType = #text or meType = #field
#script:
return FALSE
end case
end
on beginSprite me
pMeSpriteNum = me.spriteNum
pMeMemberNum = sprite(pMeSpriteNum).memberNum
pMeCastLibNum = sprite(pMeSpriteNum).castLibNum
pMeLastLine = 0
pMeForeColor = member(pMeMemberNum, pMeCastLibNum).foreColor
pMeAltForeColor = 1 -- here enter the colour number of highlited text in text (not field !) member
pMeLineCount = member(pMeMemberNum, pMeCastLibNum).line.count
pMeType = member(pMeMemberNum, pMeCastLibNum).type
end
on mouseWithin me
if me.pMeType = #text then
pMouseLineNum = pointToLine(sprite(pMeSpriteNum), the mouseLoc)
member(pMeMemberNum, pMeCastLibNum).line[pMouseLineNum].foreColor = pMeAltForeColor
if pMeLastLine <> 0 and pMeLastLine <> pMouseLineNum then
member(pMeMemberNum, pMeCastLibNum).line[pMeLastLine].foreColor = pMeForeColor
end if
pMeLastLine = pMouseLineNum
else
pMouseLineNum = the mouseLine
member(pMeMemberNum, pMeCastLibNum).line[pMouseLineNum].hilite()
end if
end
on mouseLeave me
if me.pMeType = #text then
member(pMeMemberNum, pMeCastLibNum).foreColor = pMeForeColor
pMeLastLine = 0
else
member(pMeMemberNum, pMeCastLibNum).line[pMeLineCount + 1].hilite()
end if
end
on mouseUp me
pLineClicked = pMouseLineNum
-- Here you can enter your code handling onMouseUp event,
-- or you can call pLineClicked property of this sprite to get the clicked line number.
put member("ZGTSB-SampleTargetList").line[pLineClicked] -- this is an example.
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA