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

  1. property myAction, myParams, ancestor, myObj, updateBeforeAction, hasText, makeSoundDown, makeSoundUp
  2.  
  3. on beginSprite me
  4.   if makeSoundDown = #none then
  5.     set makeSoundDown to 0
  6.   else
  7.     set makeSoundDown to the number of member string(makeSoundDown)
  8.   end if
  9.   if makeSoundUp = #none then
  10.     set makeSoundUp to 0
  11.   else
  12.     set makeSoundUp to the number of member string(makeSoundUp)
  13.   end if
  14.   set ancestor to new(script "BasicBtnBhvr")
  15.   init(me)
  16.   set myObj to value(myObj)
  17.   if hasText then
  18.     set theSprite to the mySprite of me - 1
  19.     set the scriptInstanceList of sprite theSprite to [me]
  20.     set the locH of sprite theSprite to the locH of sprite the mySprite of me - (the width of the member of sprite theSprite / 2) + 10
  21.     set the locV of sprite theSprite to the locV of sprite the mySprite of me - 3 + the height of the member of sprite the mySprite of me
  22.   end if
  23. end
  24.  
  25. on doAction me
  26.   if updateBeforeAction then
  27.     updateStage()
  28.   end if
  29.   call(myAction, myObj, myParams)
  30. end
  31.  
  32. on getPropertyDescriptionList
  33.   set x to [#none, "-", #changeGraphicType, "-", #addFrame, #duplicateFrame, #deleteFrame, #changeFrameSize, "-", #flipSelection, #deleteSelection, #layerSelection, #editText, "-", #newFile, #openFile, #saveFile, #printFile, #adjustSound, #quitProgram, "-", #scrollRow]
  34.   set s to ["gObj1", "gObj2", "gObj3", "gObj4", "gObj5", "gObj6"]
  35.   return [#myAction: [#comment: "Handler:", #format: #symbol, #range: x, #default: getAt(x, 1)], #myObj: [#comment: "Object to send to:", #format: #script, #range: s, #default: 1], #myParams: [#comment: "Params:", #format: #integer, #default: VOID], #updateBeforeAction: [#comment: "Update before Action:", #format: #boolean, #default: 1], #hasText: [#comment: "Has text:", #format: #boolean, #default: 0], #makeSoundDown: [#comment: "Make soundDown:", #format: #symbol, #range: [#none, #btnDown], #default: 1], #makeSoundUp: [#comment: "Make soundUp:", #format: #symbol, #range: [#none, #btnUp, #switchRow, #layerUp, #layerDown], #default: 1]]
  36. end
  37.