-- HYPERLINK STYLE -- -- HISTORY -- -- 17 May 1999: version 1.0.1, written by James Newton with -- suggestions from Joachim Gola, Glenn Ruehle and -- Hudson L. Ansley. -- 13 September 2000: revised -- PROPERTIES -- property spriteNum -- author-defined parameters -- hyperlink styles property pResetStates -- if TRUE all hyperlinkStates initialise as -- #normal property pNormalColor -- hexString, then color object, for #normal -- color property pActiveColor -- hexString, then color object, for #active -- color property pVisitedColor -- hexString, then color object, for #visited -- color property pBold -- if TRUE, links appear bold property pItalic -- if TRUE, links appear in italics property pUnderline -- if TRUE, links appear underlined -- cursor property myCursorType -- Allows choice of types if #cursor or 1-bit -- members property myBuiltInCursor -- Chosen or default built-in cursor number property myCursorMember -- Chosen or default #cursor member (if -- present) property myCustomCursor -- Chosen or default #bitmap member (if -- present) property myCustomMask -- Chosen or default #bitmap member for mask -- internal properties property mySprite -- cached reference to sprite (spriteNum) property myTextMember -- reference to the text member of the sprite property myHyperLinks -- list of hyperlink ranges within member property myLinkStyle -- list of fontStyles, eg [#bold, #underline] property myActiveRange -- range of the hyperlink that was clicked -- eg: [36, 45] property myLinkRef -- reference to the text chunk of the clicked -- link property myLinkOriginalColor -- color of the link before it was -- clicked property myMouseInClickedLink -- TRUE if mouse is held down in the -- clicked link property myCursor -- chosen cursor to display when pointer is -- over a link property myCursorIsHot -- TRUE if pointer is currently over a link -- EVENT HANDLERS -- on beginSprite(me) me.initialize() end beginSprite on mouseDown(me) mousePoint = the mouseLoc if pointInHyperLink(mySprite, mousePoint) then -- Set properties in preparation for a mouseUp on the same link me.activateLink(pointToChar(mySprite, mousePoint)) else if ilk(myLinkRef, #instance) then -- Ensure that an out-of-date link is not used mistakenly on -- mouseUp me.releaseLink() end if end mouseDown on mouseUp(me) if ilk(myLinkRef) = #instance then -- The mouseDown was on a link... mousePoint = the mouseLoc if pointInHyperLink(mySprite, mousePoint) then -- ... and the pointer is now over a link ... hotChar = pointToChar(mySprite, mousePoint) range = myTextMember.char[hotChar].hyperlinkRange if range <> myActiveRange then -- ... but it is not the one that was clicked on me.releaseLink() exit end if -- Pointer is over the link that was clicked on: visit the link data = myLinkRef.hyperlink me.visitLink(data, range) else me.releaseLink() end if end if end mouseUp on mouseUpOutside(me) if listP(myActiveRange) then me.releaseLink() end if end mouseUpOutside on mouseLeave(me) myCursorIsHot = FALSE cursor -1 end mouseLeave on exitFrame(me) if the rollover = spriteNum then if the mouseDown then if ilk(myLinkRef) = #instance then -- There is a link to update: change the color of the link -- text according to the pointer position me.updateState(pointToChar(mySprite, the mouseLoc)) end if else -- Change the cursor if the pointer moves on or off a hyperlink me.updateCursor() end if end if end exitFrame -- PRIVATE METHODS -- on initialize(me) ---------------------------------------------------- -- sent by beginSprite() -------------------------------------------------------------------- mySprite = sprite(spriteNum) myTextMember = mySprite.member myTextMember.useHypertextStyles = FALSE -- Create a color object for each link state pNormalColor = me.parseHexString(pNormalColor) pActiveColor = me.parseHexString(pActiveColor) pVisitedColor = me.parseHexString(pVisitedColor) -- Create the fontStyle for all anchors myLinkStyle = [] if pBold then myLinkStyle.append(#bold) if pItalic then myLinkStyle.append(#italic) if pUnderline then myLinkStyle.append(#underline) -- Set the style and color of each hyperlink myHyperLinks = myTextMember.hyperLinks linkCount = myHyperLinks.count() repeat while linkCount range = myHyperLinks[linkCount] linkRef = myTextMember.char[range[1]..range[2]].ref if pResetStates then linkRef.hyperlinkState = #normal linkRef.color = pNormalColor else case linkRef.hyperlinkState of #normal: linkRef.color = pNormalColor #active: linkRef.color = pActiveColor #visited: linkRef.color = pVisitedColor end case end if linkRef.fontStyle = myLinkStyle linkCount = linkCount - 1 end repeat me.setLinkCursor() end initialize on parseHexString(me, hexedString) ------------------------------------ -- sent by initialize() -- -- Returns the rgb color object which corresponds to the value of -- the hexedString. The same effect can be achieved using the -- syntax: -- -- return rgb(hexedString) -- -- However, this handler allows the behavior to warn the author if -- the hexedString entered in the Behavior Parameters Dialog is -- invalid in any way. An error alert will be displayed at -- authortime. A default value of rgb(0, 0, 0) (black) is returned -- if the hexedString is invalid -- This handler was optimized by Hudson L. Ansley -------------------------------------------------------------------- if hexedString.char[1] <> "#" then put "#" before hexedString -- The checked hexString(rgbVal) value will begin with the "#" -- character end if rgbVal = rgb( hexedString) if hexString(rgbVal) = hexedString then return rgbVal else call(#errorAlert, [me], #invalidHexString, hexedString) return rgb(0, 0, 0) end if end parseHexString on activateLink(me, activeChar) -------------------------------------- -- sent by mouseDown() -- -- Shows that the link is active when the mouse is held down over it -------------------------------------------------------------------- myActiveRange = myTextMember.char[activeChar].hyperlinkRange myLinkRef =myTextMember.char[myActiveRange[1]..myActiveRange[2]].ref myLinkOriginalColor = myLinkRef.color myLinkRef.color = pActiveColor end activateLink on updateState(me, theChar) ------------------------------------------ -- sent by exitFrame() -- -- Alters the color of the link that was clicked on according to the -- position of the pointer relative to the link text -------------------------------------------------------------------- if theChar < 1 then -- The mouse is not over text sprite: revert to the original color myLinkRef.color = myLinkOriginalColor exit end if range = myTextMember.char[theChar].hyperlinkRange if range = myActiveRange then -- The pointer is now over the link that was clicked if not myMouseInClickedLink then myMouseInClickedLink = TRUE myLinkRef.color = pActiveColor end if else -- The pointer is elsewhere if myMouseInClickedLink then myMouseInClickedLink = FALSE myLinkRef.color = myLinkOriginalColor end if end if end updateState on visitLink(me, data, range) ---------------------------------------- -- sent by mouseUp() -- -- Set the state and color of the link to show that it has been -- visited ... -------------------------------------------------------------------- myLinkRef.hyperlinkstate = #visited myLinkRef.color = pVisitedColor -- ... and call any handler on the same sprite that might need to be -- executed call(#hyperLinkClicked, mySprite.scriptInstanceList, data, range) -- Forget any references to the link that was clicked on myActiveRange = void myLinkRef = void end visitLink on releaseLink(me, activeChar) --------------------------------------- -- sent by mouseDown(), mouseUp(), mouseUpOutside(), visitLink() -- -- Stops tracking the position of the pointer with respect to the -- hyperlink that was clicked on, and sets that hyperlink's color to -- what it was. -------------------------------------------------------------------- if myLinkRef.hyperLinkState <> #visited then -- Don't leave the link active myLinkRef.hyperLinkState = #normal end if -- Reset the color myLinkRef.color = myLinkOriginalColor -- Forget any references to the link that was clicked on myActiveRange = void myLinkRef = void end releaseLink on setLinkCursor(me) ------------------------------------------------- -- sent by initialize() -------------------------------------------------------------------- if voidP(myCursorType) then -- Only built-in cursors are available: use the chosen cursor myCursor = myBuiltInCursor exit end if -- A choice of cursor types is available: use the chosen type. case myCursorType of "Built-in cursor": theCursor = myBuiltInCursor "Cursor member": -- The member may be in the form of a string theCursor = value(myCursorMember) "1 bit bitmap": -- The member may be in the form of a string myCustomCursor = value(myCustomCursor) -- Only the 1-bit member for the cursor itself is essential ... theCursor = [myCustomCursor.number] if myCustomMask <> "no mask" then -- ... but a mask has also been chosen myCustomMask = value(myCustomMask) theCursor.append(myCustomMask.number) end if end case -- Adopt the chosen cursor myCursor = theCursor end setLinkCursor on updateCursor(me) -------------------------------------------------- -- sent by exitFrame() -------------------------------------------------------------------- if pointInHyperLink(mySprite, the mouseLoc) then -- The mouse is over a hyperlink... if not myCursorIsHot then -- ... which it has only just entered myCursorIsHot = TRUE cursor myCursor end if else -- The mouse is not over a hyperlink... if myCursorIsHot then -- ... but it just left one myCursorIsHot = FALSE cursor -1 end if end if end updateCursor --< OPTIONAL PUBLIC METHODS >-- -- The handlers in this section may be deleted if -- no Lingo calls are used with the behavior. on hyperlink_GetReference(me, theList) ------------------------------- -- Returns a reference to the current behavior. theList is an -- optional parameter. Use an empty list in a sendAllSprites call -- to return a list of all "Hyperlink style" behaviors in the -- current frame. Use an empty linear list to obtain a list of -- behaviors, or an empty property list to return a list with sprite -- numbers as the properties and behavior references as the values. -- Examples : -- -- put sendAllSprites(#hyperlink_GetReference, []) -- -- [] -- -- put sendAllSprites(#hyperlink_GetReference, [:]) -- -- [1: ] -- -- If you leave "theList" void then the handler will return a -- reference to the behavior on the given sprite (using sendSprite) -- or the highest sprite with the behavior (using sendAllSprites). -- Examples: -- -- put sendSprite(1, #hyperlink_GetReference) -- -- -- -- put sendAllSprites(#hyperlink_GetReference) -- -- -------------------------------------------------------------------- case ilk(theList) of #list: theList.append(me) #propList: theList.addProp(me.spriteNum, me) otherwise return me end case return theList end hyperlink_GetReference on hyperlink_ResetLinkStates(me) ------------------------------------- -- Sets the hyperlinkState of all links in myTextMember to #normal -------------------------------------------------------------------- linkCount = myHyperLinks.count() repeat while linkCount range = myHyperLinks[linkCount] linkRef = myTextMember.char[range[1]..range[2]].ref linkRef.hyperlinkState = #normal linkRef.color = pNormalColor linkCount = linkCount - 1 end repeat end hyperlink_ResetLinkStates on hyperlink_SetStateColor(me, colorList) ---------------------------- -- Changes the color in which given hyperlinkStates are displayed. -- colorList must be a property list. It can contain any or all of -- the following properties: -- #normal -- #active -- #visited -- The values of such properties must be a valid color object. -- Examples: -- -- blue = rgb(0, 0, 128) -- sendAllSprites(#hyperlink_SetStateColor, [#visited: blue]) -- -- blue = rgb(0, 0, 128) -- sendSprite(1, #hyperlink_SetStateColor, [#visited: blue]) -- -- blue = rgb(0, 0, 128) -- hyperLinkRef = sendAllSprites(#hyperlink_GetReference) -- hyperLinkRef.hyperlink_SetStateColor([#visited: blue]) -- -- The handler returns the result 0 if it successfully changes the -- color of a hyperlinkState. Otherwise it returns the symbol -- #invalidColor. -------------------------------------------------------------------- changeNormal = FALSE changeActive = FALSE changeVisited = FALSE if ilk(colorList) <> #propList then return #invalidPropList end if -- Ensure that the values sent are color objects, and determine -- which state colors need to be changed. normalColor = colorList[#normal] if ilk(normalColor) = #color then pNormalColor = normalColor changeNormal = TRUE end if activeColor = colorList[#active] if ilk(activeColor) = #color then pActiveColor = activeColor changeActive = TRUE end if visitedColor = colorList[#visited] if ilk(visitedColor) = #color then pVisitedColor = visitedColor changeVisited = TRUE end if if not(changeNormal + changeActive + changeVisited) then -- colorList contained no valid symbols or color objects return #invalidColor end if -- Set the color of those links whose color object has changed linkCount = myHyperLinks.count() repeat while linkCount range = myHyperLinks[linkCount] linkRef = myTextMember.char[range[1]..range[2]].ref case linkRef.hyperlinkState of #normal: if changeNormal then linkRef.color = pNormalColor #active: if changeActive then linkRef.color = pActiveColor #visited: if changeVisited then linkRef.color = pVisitedColor end case linkCount = linkCount - 1 end repeat return 0 -- No error end hyperlink_SetStateColor on hyperlink_SetFontStyle(me, styleList) ----------------------------- -- Changes the fontStyle in which hyperlinks are displayed. -- styleList must be a linear list. It can contain any or all of -- the following symbols: -- #plain -- #bold -- #italic -- #underline -- #superscript -- #subscript -- #strikeOut -- -- Any other symbols will be filtered from the list. -- -- Examples: -- -- sendAllSprites(#hyperlink_SetFontStyle, [#underline]) -- -- sendSprite(1, #hyperlink_SetFontStyle, [#bold, #italic]) -- -- hyperLinkRef = sendAllSprites(#hyperlink_GetReference) -- hyperLinkRef.hyperlink_SetFontStyle([#plain]) -- -- The handler returns the result 0 if it successfully changes the -- fontStyle of the link texts. Otherwise it returns the symbol -- #invalidStyle. -------------------------------------------------------------------- if ilk(styleList) <> #list then return #invalidPropList end if -- Filter any invalid symbols from styleList textStyles = [ \ #plain, \ #bold, \ #italic, \ #underline, \ #superscript, \ #subscript, \ #strikeOut \ ] styleCount = styleList.count() repeat while styleCount if not textStyles.getPos(styleList[styleCount]) then styleList.deleteAt(styleCount) end if styleCount = styleCount - 1 end repeat if not styleList.count() then -- styleList is empty, or included only invalid symbols return #invalidStyle end if -- Set the style of all links in the text member linkCount = myHyperLinks.count() repeat while linkCount range = myHyperLinks[linkCount] linkRef = myTextMember.char[range[1]..range[2]].ref linkRef.fontStyle = styleList linkCount = linkCount - 1 end repeat return 0 -- no Error end hyperlink_SetFontStyle on hyperlink_SetCursor(me, cursorData) ------------------------------- -- Changes the cursor which appears when the pointer is over a -- hyperlink -- can be a cursorMember, a linear list of 16x16 pixel -- 1-bit bitmap members, or an integer or symbol which designates a -- built-in cursor. (See the list below for accepted integers and -- the corresponding symbols, in the order they appear in the -- Behavior Parameters Dialog pop-up menu.). -- -- Examples: -- -- sendAllSprites(#hyperlink_SetCursor, 280) -- sendAllSprites(#hyperlink_SetCursor, #finger) -- -- sendSprite(1, #hyperlink_SetCursor, member "customCursor") -- -- cursorData = [member "customCursor", member "customMask"] -- hyperLinkRef = sendAllSprites(#hyperlink_GetReference) -- hyperLinkRef.hyperlink_SetCursor(cursorData) -- -- The handler returns the result 0 if it successfully changes the -- cursor to be displayed when the pointer is over a hyperlink. -- Otherwise it returns the symbol #invalidCursor. -------------------------------------------------------------------- cursorType = ilk(cursorData) case cursorType of #integer, #symbol: cursorList = [ \ 1: #iBeam, \ 2: #crossHair, \ 3: #crossBar, \ 4: #watch, \ 200: #blank, \ 254: #help, \ 280: #finger, \ 260: #hand, \ 290: #closedHand, \ 291: #noDropHand, \ 256: #pencil, \ 257: #eraser, \ 258: #select, \ 259: #bucket, \ 272: #lasso, \ 281: #dropper, \ 301: #airBrush, \ 302: #zoomIn, \ 303: #zoomOut, \ 284: #verticalSize, \ 285: #horizontalSize, \ 286: #diagonalSize \ ] cursorList.addProp(-1, #arrow) if cursorType = #symbol then cursorData = cursorList.getOne(cursorData) if cursorData then myCursor = cursorData else if cursorList.findPos(cursorData) then myCursor = cursorData end if end if end if #member: case(cursorData.type) of #cursor: myCursor = cursorData #bitmap: if cursorData.depth = 1 then myCursor = cursorData else return #invalidCursor end if end case #list: if not cursorData.count then -- The list is empty return #invalidCursor end if -- The first item in the list must indicate an appropriate cast -- member This can be either the member's number or a reference -- to the member. cursorMember = cursorData[1] if integerP(cursorMember) then if cursorMember > 0 then -- Convert to a member reference for the next step cursorMember = member(cursorMember) else -- Members cannot have a number less than 1 return #invalidCursor end if end if if ilk(cursorMember) <> #member then -- Conversion to a valid member reference is impossible return #invalidCursor end if case(cursorMember.type) of #cursor: myCursor = cursorData #bitmap: -- The bitmaps in the list must have a (color)depth of 1-bit if cursorMember.depth <>1 then return #invalidCursor end if if cursorData.count() = 1 then -- Only one bitmap member cursor is available: use it myCursor = cursorData else -- Cursor member is valid: add the mask if appropriate maskMember = cursorData[2] cursorData = [cursorMember] -- Follow the same steps as for the cursorMember above if integerP(maskMember) then if cursorMember > 0 then maskMember = member(maskMember) end if end if if ilk(maskMember) = #member then if maskMember.type = #bitmap then if maskMember.depth = 1 then -- The second member in the list is usable as a mask cursorData.append(maskMember) end if end if end if -- cursorData may now include 1 or 2 member references myCursor = cursorData end if otherwise -- The first member in list is neither #cursor nor #bitmap return #invalidCursor end case otherwise -- cursorData is neither #integer, #member nor #list return #invalidCursor end case if pointInHyperLink(mySprite, the mouseLoc) then -- Change the cursor immediately since it is currently over a link cursor myCursor end if return 0 -- no Error end hyperlink_SetCursor --< OPTIONAL ERROR CHECKING HANDLERS >-- on errorAlert(me, theError, data) ------------------------------------ -- Sent by getPropertyDescriptionList(), initialize(), -- parseHexString() -- -- This handler is called using the syntax: -- -- call(#errorAlert, [me], #errorSymbol, ) -- -- If you cut this handler from the behavior, the behavior will -- continue to function correctly. However you will have no feed- -- back concerning any implementation errors. -------------------------------------------------------------------- -- Determine the behavior's name behaviorName = string(me) delete word 1 of behaviorName delete the last word of behaviorName delete the last word of behaviorName case theError of #invalidMemberType: if the runMode = "Author" then alert \ "BEHAVIOR ERROR: Frame "&the frame&", Sprite "&me.spriteNum&\ RETURN&RETURN&\ "Behavior "&behaviorName&" only works with Text members."&\ RETURN&RETURN&"Current member type = #"&data -- Select the sprite on Stage and in the Score me.selectSprite() end if #invalidHexString: if the runMode = "Author" then alert \ "BEHAVIOR ERROR: Frame "&the frame&", Sprite "&me.spriteNum&RETURN&\ "Behavior "&behaviorName&RETURN&RETURN&\ "The color entered in the Behavior Parameters Dialog is an invalid hexString."&RETURN&RETURN&data -- Select the sprite on Stage and in the Score me.selectSprite() end if end case end errorAlert on selectSprite(me) thisFrame = mySprite.startFrame thatFrame = mySprite.endFrame the scoreSelection = [[spriteNum, spriteNum, thisFrame, thatFrame]] halt end selectSprite --< END OF OPTIONAL HANDLERS >-- -- UTILITY HANDLERS -- on getCursorMembers(me) ---------------------------------------------- -- sent by getPropertyDescriptionList() -- -- Returns a list of #cursor members -------------------------------------------------------------------- cursorMembersList = [] maxCastLib = the number of castLibs repeat with theCastLib = 1 to maxCastLib maxMember = the number of members of castLib theCastLib repeat with memberNumber = 1 to maxMember theMember = member(memberNumber, theCastLib) if theMember.type = #cursor then if theMember.name = EMPTY then cursorMembersList.append(theMember) else cursorMembersList.append(theMember.name) end if end if end repeat end repeat return cursorMembersList end getCursorMembers on getCursorBitmaps(me) ---------------------------------------------- -- sent by getPropertyDescriptionList() -- -- Returns a list of 1-bit bitmap members with a size of less than -- 20x20 pixels. Such bitmaps could be intended as custom cursors -------------------------------------------------------------------- cursorBitmapsList = [] maxCastLib = the number of castLibs repeat with theCastLib = 1 to maxCastLib maxMember = the number of members of castLib theCastLib repeat with memberNumber = 1 to maxMember theMember = member(memberNumber, theCastLib) if theMember.type = #bitmap then if theMember.depth > 1 then next repeat if theMember.width > 20 then next repeat if theMember.height > 20 then next repeat if theMember.name = EMPTY then cursorBitmapsList.append(theMember) else cursorBitmapsList.append(theMember.name) end if end if end repeat end repeat return cursorBitmapsList end getCursorBitmaps -- BEHAVIOR DESCRIPTION AND PARAMETERS -- on isOKToAttach(me, spriteType, spriteNumber) -- Allow only #text members if spriteType = #graphic then return sprite(spriteNumber).member.type = #text end if return FALSE end isOKToAttach on getPropertyDescriptionList(me) -- The propertyDescriptionList contains two parts: a fixed part -- concerning the colors and font styles for hyperlinks, and a -- variable part for choosing the cursor to display when the pointer -- is over a hyperlink. The choice depends on the availabilty of -- #cursor members or appropriate 1-bit bitmaps. propertiesList = [:] -- Create the 'fixed' part of the propertyDescriptionList propertiesList[ \ #pResetStates] = [ \ #comment: "Reset link states to normal on beginSprite?", \ #format: #boolean, \ #default: TRUE \ ] propertiesList[ \ #pNormalColor] = [ \ #comment: "LINK COLOR - normal:", \ #format: #string, \ #default: "#0000FF" \ ] propertiesList[ \ #pActiveColor] = [ \ #comment: "- active:", \ #format: #string, \ #default: "#FF0000" \ ] propertiesList[ \ #pVisitedColor] = [ \ #comment: "- visited:", \ #format: #string, \ #default: "#FF00FF" \ ] propertiesList[ \ #pBold] = [ \ #comment: "LINK STYLE - bold:", \ #format: #boolean, \ #default: FALSE \ ] propertiesList[ \ #pItalic] = [ \ #comment: "- italic:", \ #format: #boolean, \ #default: FALSE \ ] propertiesList[ \ #pUnderline] = [ \ #comment: "- underline:", \ #format: #boolean, \ #default: TRUE \ ] -- Determine what types of cursors may be available cursorTypes = [] cursorMembersList = me.getCursorMembers() cursorBitmapsList = me.getCursorBitmaps() cursorMembers = cursorMembersList.count() bitmapCursors = cursorBitmapsList.count() -- Add #cursor members and 1-bit bitmaps to the list of available -- cursors if the appropriate members are available if cursorMembers then cursorTypes.append("Cursor member") end if if bitmapCursors then cursorTypes.append("1 bit bitmap") cursorMasksList = cursorBitmapsList.duplicate() cursorMasksList.addAt(1, "no mask") end if if cursorTypes.count() then -- There is a choice of cursor types cursorTypes.addAt(1, "Built-in cursor") propertiesList[ \ #myCursorType] = [ \ #comment: "CHOICE OF TYPE - Use which type of cursor?", \ #format: #string, \ #range: cursorTypes, \ #default: cursorTypes[1]\ ] propertiesList[ \ #myBuiltInCursor] = [ \ #comment: "CHOICE OF CURSOR - Built-in cursor:", \ #format: #cursor, \ #default: 280\ ] else -- Only built-in cursors are available propertiesList[ \ #myBuiltInCursor] = [ \ #comment: "Use which cursor?", \ #format: #cursor, \ #default: 280\ ] end if if cursorMembers then -- There is at least one #cursor member available propertiesList[ \ #myCursorMember] = [ \ #comment: "- Cursor member:", \ #format: #member, \ #range: cursorMembersList, \ #default: cursorMembersList[1] \ ] end if if bitmapCursors then -- There is at least one 1-bit #bitmap member available... propertiesList[ \ #myCustomCursor] = [ \ #comment: "- 1 bit bitmap (image):", \ #format: #bitmap, \ #range: cursorBitmapsList, \ #default: cursorBitmapsList[1]\ ] -- ... and it may have a mask, or be used as its own mask propertiesList[ \ #myCustomMask] = [ \ #comment: "1 bit bitmap (mask):", \ #format: #bitmap, \ #range: cursorMasksList, \ #default: cursorMasksList[1]\ ] end if return propertiesList end getPropertyDescriptionList on getBehaviorTooltip(me) return \ "Use with Text members which contain hyperlinks."&RETURN&\ "This behavior allows you to customize the color"&RETURN&\ "and fontStyle of the anchor text, and determine"&RETURN&\ "which cursor should appear when the pointer is"&RETURN&\ "over a hyperlink. This gives you an alternative"&RETURN&\ "to the built-in 'useHypertextStyles' property for"&RETURN&\ "text members." end getBehaviorTooltip on getBehaviorDescription(me) return \ "HYPERLINK STYLE"&RETURN&RETURN&\ "Use this behavior with Text members which contain hyperlinks. It allows you to customize the color and fontStyle of the anchor text, and determine which cursor should appear when the pointer is over a hyperlink. This gives you an alternative to the built-in 'useHypertextStyles' property for text members."&RETURN&RETURN&\ "TIP: This behavior does not itself contain an 'on hyperlinkClicked' handler. Use the 'Hypertext - General' behavior on the same sprite to perform a gotoNetPage command or execute custom Lingo when a link is clicked."&RETURN&RETURN&\ "NOTE: This behavior waits for a 'mouseUp' on the link which was initially clicked before calling any 'on hyperlinkClicked' handlers which may be present on the same sprite. This means that users can change their mind about activating a link by releasing the mouse button while the cursor is not over the link they clicked on. The link will only appear as active if the cursor is held down over it."&RETURN&RETURN&\ "PARAMETERS:"&RETURN&\ " * Reset all hyperlinks to #normal (unvisited) on beginSprite (TRUE | FALSE)"&RETURN&\ " * Color of link text (HexString, eg: #FF8800)"&RETURN&\ " - normal (unvisited)"&RETURN&\ " - active"&RETURN&\ " - visited"&RETURN&\ " * Style of link text"&RETURN&\ " - bold (TRUE | FALSE)"&RETURN&\ " - italic (TRUE | FALSE)"&RETURN&\ " - underline (TRUE | FALSE)"&RETURN&\ " * Cursor"&RETURN&\ " - Type of cursor to use (built-in | #cursor member | 1-bit bitmaps)"&RETURN&\ " - Identity of cursor to use (name or member)"&RETURN&RETURN&\ "Note: Only certain cursor types may appear, depending on the custom cursor elements which may currently be available in the various castLibs."&RETURN&RETURN&\ "PUBLIC METHODS:"&RETURN&\ " => Reset all hyperlinkStates to #normal"&RETURN&\ " => Set the colors of the various hyperlinkStates"&RETURN&\ " => Set the fontStyle of the hyperlinks"&RETURN&\ " => Set the cursor which appears when the pointer is over a link"&\ RETURN&\ " => Get the behavior reference" end getBehaviorDescription