home *** CD-ROM | disk | FTP | other *** search
- property numOfSlots, firstSlotNS, castName, scrollDir, voidCrop, numOfCrops
- global gCurrentStartCrop, gCropList, gCanClick
-
- on beginSprite
- set numOfCrops to the number of castMembers of castLib castName
- if scrollDir = #left then
- set gCropList to []
- repeat with i = 1 to numOfCrops
- add(gCropList, the name of member i of castLib castName)
- end repeat
- set gCurrentStartCrop to 1
- aggiornaFreccie()
- end if
- end
-
- on mouseUp
- if gCanClick then
- if scrollDir = #right then
- set gCurrentStartCrop to gCurrentStartCrop + 2
- else
- set gCurrentStartCrop to gCurrentStartCrop - 2
- end if
- updateCrops()
- aggiornaFreccie()
- updateStage()
- end if
- end
-
- on updateCrops
- repeat with i = 1 to numOfSlots
- set Ns to firstSlotNS + i - 1
- set nm to getAt(gCropList, gCurrentStartCrop + (2 * (i - 1)))
- if nm <> EMPTY then
- set the member of sprite Ns to member nm of castLib castName
- set the moveableSprite of sprite Ns to 1
- else
- set the member of sprite Ns to member voidCrop
- set the moveableSprite of sprite Ns to 0
- end if
- set Ns to firstSlotNS + i + 2
- set nm to getAt(gCropList, gCurrentStartCrop + (2 * (i - 1)) + 1)
- if nm <> EMPTY then
- set the member of sprite Ns to member nm of castLib castName
- set the moveableSprite of sprite Ns to 1
- next repeat
- end if
- set the member of sprite Ns to member voidCrop
- set the moveableSprite of sprite Ns to 0
- end repeat
- end
-
- on aggiornaFreccie
- set Ns to the currentSpriteNum
- if scrollDir = #right then
- if gCurrentStartCrop < (numOfCrops - (numOfSlots * 2) + 1) then
- set the visible of sprite Ns to 1
- else
- set the visible of sprite Ns to 0
- end if
- if gCurrentStartCrop > 1 then
- set the visible of sprite (Ns - 1) to 1
- else
- set the visible of sprite (Ns - 1) to 0
- end if
- else
- if gCurrentStartCrop > 1 then
- set the visible of sprite Ns to 1
- else
- set the visible of sprite Ns to 0
- end if
- if gCurrentStartCrop < (numOfCrops - (numOfSlots * 2) + 1) then
- set the visible of sprite (Ns + 1) to 1
- else
- set the visible of sprite (Ns + 1) to 0
- end if
- end if
- end
-
- on getPropertyDescriptionList
- set d to [:]
- addProp(d, #numOfSlots, [#default: 3, #format: #integer, #comment: "Numero di slots:"])
- addProp(d, #firstSlotNS, [#default: 15, #format: #integer, #comment: "Numero canale primo slot:"])
- addProp(d, #castName, [#default: "a_crop4", #format: #string, #comment: "Nome del castLib:"])
- addProp(d, #scrollDir, [#default: #left, #format: #symbol, #range: [#right, #left], #comment: "Direzione di scroll:"])
- addProp(d, #voidCrop, [#default: "voidCrop", #format: #string, #comment: "Nome del crop fittizio:"])
- return d
- end
-