home *** CD-ROM | disk | FTP | other *** search
/ 3D World 125 / 3DW_125.iso / pc / Interface / POPUP.dir / 00006_link_clicker.ls < prev    next >
Encoding:
Text File  |  2009-03-18  |  1.4 KB  |  60 lines

  1. property sp
  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 beginSprite me
  29.   sp = sprite(me.spriteNum)
  30.   pFormat()
  31. end
  32.  
  33. on pFormat me
  34.   t = sp.member
  35.   repeat with i = 1 to t.word.count
  36.     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
  37.       t.word[i].color = rgb(255, 255, 255)
  38.       t.word[i].fontStyle = [#plain, #underline]
  39.     end if
  40.   end repeat
  41. end
  42.  
  43. on mouseWithin me
  44.   pointClicked = the mouseLoc
  45.   currentMember = sprite(me.spriteNum).member
  46.   wordNum = sprite(me.spriteNum).pointToWord(pointClicked)
  47.   if wordNum <> -1 then
  48.     wordText2 = currentMember.word[wordNum]
  49.     if (wordText2.char[1..7] = "http://") or (wordText2 contains "@") or (wordText2.char[1..4] = "www.") or (wordText2.char[1..8] = "https://") then
  50.       cursor(280)
  51.     else
  52.       cursor(-1)
  53.     end if
  54.   end if
  55. end
  56.  
  57. on mouseLeave
  58.   cursor(-1)
  59. end
  60.