home *** CD-ROM | disk | FTP | other *** search
/ Comic Book Maker: The Smurfs / COMIC.iso / pc / data_w / cba2_40 / 00009_graphicBhvr.ls < prev    next >
Encoding:
Text File  |  2001-02-22  |  1.2 KB  |  47 lines

  1. property mySprite, isBalloon, balloonID, balloonProps, myDoubleClickTimer, myLastPos
  2. global gObj1, gObj2
  3.  
  4. on beginSprite me
  5.   set isBalloon to 0
  6.   set balloonID to 0
  7.   set mySprite to the currentSpriteNum
  8.   set curs to 0
  9. end
  10.  
  11. on mouseDown me, blockModKey
  12.   set currentFrameSize to the pCurrentFrameSize of gObj2 - 1
  13.   if inside(the clickLoc, the frameRect of gObj2) then
  14.     if not blockModKey and modKeyPressed() then
  15.       repeat with i = max(1, mySprite - 1) down to 1
  16.         if inside(the clickLoc, the rect of sprite i) then
  17.           mouseDown(sprite(i), 1)
  18.           exit
  19.         end if
  20.       end repeat
  21.     else
  22.       set curs to 1
  23.       set myLastPos to the loc of sprite mySprite
  24.       cursor(260)
  25.       selectGraphic(gObj1, mySprite)
  26.     end if
  27.   else
  28.     deselectAll(gObj1)
  29.   end if
  30. end
  31.  
  32. on mouseUp me
  33.   if the ticks < myDoubleClickTimer then
  34.     if isBalloon then
  35.       if count(the theSelection of gObj1) = 1 then
  36.         if (getAt(the theSelection of gObj1, 1) = mySprite) and (myLastPos = the loc of sprite mySprite) then
  37.           cursor(-1)
  38.           editText(gObj3)
  39.         end if
  40.       end if
  41.     end if
  42.     set myDoubleClickTimer to 0
  43.   else
  44.     set myDoubleClickTimer to the ticks + 20
  45.   end if
  46. end
  47.