home *** CD-ROM | disk | FTP | other *** search
/ 3D World 153 / 3DW_153.iso / mac / Interface / POPUP.dir / 00006_Script_link_clicker < prev   
Text File  |  2009-03-18  |  2KB  |  86 lines

  1. global currentmember,pointclicked,wordnum,wordtext2,wordtext
  2. property Sp
  3.  
  4. on mouseup me
  5.   
  6.   wordText = currentMember.word[wordNum]
  7.   --    put "Clicked word" && wordNum & ", the text" && wordText
  8.   
  9.   if wordtext contains "@" then
  10.     -- alert "you clicked email address"&&wordtext
  11.     gotonetpage ("mailto:"&wordtext)
  12.   else
  13.     nothing
  14.   end if
  15.   
  16.   if wordtext.char[1..7] = "http://" then
  17.     gotonetpage (wordtext)
  18.   else 
  19.     nothing
  20.   end if
  21.   
  22.   if wordtext.char[1..8] = "https://" then
  23.     gotonetpage (wordtext)
  24.   else 
  25.     nothing
  26.   end if
  27.   
  28.   if wordtext.char[1..4] = "www." then
  29.     gotonetpage ("http://"&wordtext)
  30.   else 
  31.     nothing
  32.   end if
  33.   
  34.   
  35. end
  36.  
  37. on beginsprite me
  38.   
  39.   Sp = sprite(me.spritenum)
  40.   pFormat()
  41.   
  42. end
  43.  
  44.  
  45. on pFormat me
  46.  
  47.   t = Sp.member
  48.  
  49.   repeat with i = 1 to t.word.count
  50.     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
  51.       t.word[i].color = rgb(255,255,255)
  52.       t.word[i].fontstyle = [#plain, #underline]
  53.     end if
  54.     
  55.   end repeat
  56.   
  57. end
  58.  
  59.  
  60.  
  61. on mousewithin me
  62.   --cursor on
  63.   
  64.   pointClicked = the mouseLoc
  65.   currentMember = sprite(me.spriteNum).member
  66.   wordNum = sprite(me.spriteNum).pointToWord(pointClicked)
  67.   
  68.   if wordnum <> -1 then
  69.     wordText2 = currentMember.word[wordNum]
  70.     
  71.     
  72.     
  73.     if wordtext2.char[1..7] = "http://" or wordtext2 contains "@" or wordtext2.char[1..4] = "www." or wordtext2.char[1..8] = "https://"then
  74.       cursor 280
  75.  
  76.     else
  77.       cursor -1
  78.     end if
  79.     
  80.   end if
  81. end
  82.  
  83.  
  84. on mouseleave
  85. cursor -1
  86. end