Allows custom colors for default and visited hyperlinks.
property spriteNum
property pDefColor
property pVisitedColor
property pMember
global gClickedList
on getPropertyDescriptionList me
p = [:]
p.addProp(#pDefColor, [#format : #color, #default : rgb(255, 0, 0), #comment : "Base Color"])
p.addProp(#pVisitedColor, [#format : #color, #default : rgb(0, 255, 0), #comment : "Visited Color"])
return p
end
on beginSprite me
if gClickedList = void then gClickedList = []
pMember= sprite(spriteNum).member
pMember.usehypertextstyles = 0
pMember.color = rgb(0,0,0)
iHyperlinks = pMember.hyperlinks
repeat with link in iHyperlinks
linkName = pMember.name & "-" & link[1] & "-" & link[2]
me.colorize(link, linkName)
end repeat
sprite(spriteNum).cursor = 0
end
on endSprite me
sprite(spritenum).cursor = 0
end
on mouseWithin me
if sprite(spriteNUm).pointInHyperlink(the mouseLoc) then
if sprite(spriteNum).cursor <> 280 then
sprite(spriteNum).cursor = 280
end if
else
if sprite(spriteNum).cursor <> 0 then
sprite(spriteNum).cursor = 0
end if
end if
end
on colorize me, link, linkName
if gClickedList.getOne(linkName) then
pMember.char[link[1]..link[2]].color = pVisitedCOlor
else
pMember.char[link[1]..link[2]].color = pDefColor
end if
end
on hyperLinkCLicked me, d, link
linkName = pMember.name & "-" & link[1] & "-" & link[2]
if gClickedList.getOne(linkName) = 0 then gClickedList.add(linkName)
me.colorize(link, linkName)
end
on getBehaviorDescription me
return "Place on a text member and set the colors for custom hyperlink colors."
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA