hyperlinkState

Usage

-- Lingo syntax
chuckExpression.hyperlinkState

// JavaScript syntax
chuckExpression.hyperlinkState;

Description

Text cast member property; contains the current state of the hyperlink. Possible values for the state are: #normal, #active, and #visited.

This property can be tested and set.

Like hyperLink and hyperLinkRange, the returned range of the link contains the first character of chunkExpression.

Example

The following handler checks to see if the hyperlink clicked is a web address. If it is, the state of the hyperlink text state is set to #visited, and the movie branches to the web address.

--Lingo syntax
property spriteNum

on hyperlinkClicked me, data, range
   if data starts "http://" then
      currentMember = sprite(spriteNum).member
      currentMember.word[4].hyperlinkState = #visited
      gotoNetPage(data)
   end if
end

// JavaScript syntax
function hyperlinkClicked(data, range) {
   var st = data.slice(0,7);
   var ht = "http://";
   if (st = ht) {
      currentMember = sprite(spriteNum).member;
      currentMember.getPropRef("word", 4).hyperlinkState = symbol("visited");
      gotoNetPage(data);
   }
}

See also

hyperlink, hyperlinkRange