home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 208 / MF_UK_208_1.iso / pc / Files / Scenes / disclaimer.dir / 00008_linkz.ls < prev    next >
Encoding:
Text File  |  2009-04-03  |  1.5 KB  |  61 lines

  1. property scrollmode, Sp, cStart
  2. global currentMember, pointClicked, wordNum, wordText2, wordText
  3.  
  4. on mouseUp me
  5.   wordText = currentMember.word[wordNum]
  6.   if wordText contains "@" then
  7.     gotoNetPage("mailto:" & wordText)
  8.   else
  9.     nothing()
  10.   end if
  11.   if wordText.char[1..7] = "http://" then
  12.     gotoNetPage(wordText)
  13.   else
  14.     nothing()
  15.   end if
  16.   if wordText.char[1..8] = "https://" then
  17.     gotoNetPage(wordText)
  18.   else
  19.     nothing()
  20.   end if
  21.   if wordText.char[1..4] = "www." then
  22.     gotoNetPage("http://" & wordText)
  23.   else
  24.     nothing()
  25.   end if
  26. end
  27.  
  28. on linkUpdate me
  29.   t = sprite(me.spriteNum).member
  30.   repeat with i = 1 to t.word.count
  31.     if (t.word[i].char[1..7] = "http://") or (t.word[i] contains "@") or (t.word[i].char[1..4] = "www.") or (t.word[i].char[1..8] = "https://") then
  32.       t.word[i].color = rgb(255, 0, 255)
  33.     end if
  34.   end repeat
  35. end
  36.  
  37. on beginSprite me
  38.   me.linkUpdate()
  39. end
  40.  
  41. on mouseWithin me
  42.   pointClicked = the mouseLoc
  43.   currentMember = sprite(me.spriteNum).member
  44.   wordNum = sprite(me.spriteNum).pointToWord(pointClicked)
  45.   if wordNum <> -1 then
  46.     wordText2 = currentMember.word[wordNum]
  47.     if (wordText2.char[1..7] = "http://") or (wordText2 contains "@") or (wordText2.char[1..4] = "www.") or (wordText2.char[1..8] = "https://") then
  48.       cursor(280)
  49.       currentMember.word[wordNum].color = rgb(255, 0, 255)
  50.       currentMember.word[wordNum].fontStyle = [#underline]
  51.     else
  52.       cursor(-1)
  53.       currentMember.fontStyle = [#plain]
  54.     end if
  55.   end if
  56. end
  57.  
  58. on mouseLeave
  59.   cursor(-1)
  60. end
  61.