home *** CD-ROM | disk | FTP | other *** search
- property dynamicSprite, regionList, active
-
- on new me, dSprite, rList
- set dynamicSprite to dSprite
- set regionList to duplicate(rList)
- set active to 1
- set the visible of sprite dynamicSprite to 0
- puppetSprite(dynamicSprite, 1)
- updateStage()
- return me
- end
-
- on death me
- puppetSprite(dynamicSprite, 0)
- set the visible of sprite dynamicSprite to 1
- updateStage()
- end
-
- on updateButton me
- global gButUpdated, gAudioWindow, gquitWindow
- set currH to the mouseH
- set currV to the mouseV
- if objectp(gAudioWindow) then
- return
- end if
- if objectp(gquitWindow) then
- return
- end if
- if active then
- set inRegion to 0
- repeat with i = 1 to count(regionList)
- set regionRect to getAt(getAt(regionList, i), 1)
- if (currH > getAt(regionRect, 1)) and (currH < getAt(regionRect, 3)) and (currV > getAt(regionRect, 2)) and (currV < getAt(regionRect, 4)) then
- set the locH of sprite dynamicSprite to getAt(getAt(getAt(regionList, i), 2), 1)
- set the locV of sprite dynamicSprite to getAt(getAt(getAt(regionList, i), 2), 2)
- if the mouseDown then
- set the memberNum of sprite dynamicSprite to getAt(getAt(regionList, i), 4)
- else
- set the memberNum of sprite dynamicSprite to getAt(getAt(regionList, i), 3)
- end if
- set the visible of sprite dynamicSprite to 1
- set gButUpdated to 1
- set inRegion to 1
- exit repeat
- end if
- end repeat
- if inRegion = 0 then
- set the visible of sprite dynamicSprite to 0
- end if
- else
- set the visible of sprite dynamicSprite to 0
- end if
- end
-
- on buttonMouseUp me
- global gButMovie, gButFrame, gButRegionLists, gButCalled
- set currH to the mouseH
- set currV to the mouseV
- if active then
- if voidp(gButCalled) then
- set gButCalled to 0
- end if
- if gButCalled = 1 then
- return
- end if
- set inRegion to 0
- repeat with i = 1 to count(regionList)
- set regionRect to getAt(getAt(regionList, i), 1)
- if (currH > getAt(regionRect, 1)) and (currH < getAt(regionRect, 3)) and (currV > getAt(regionRect, 2)) and (currV < getAt(regionRect, 4)) then
- updateStage()
- set the locH of sprite dynamicSprite to getAt(getAt(getAt(regionList, i), 2), 1)
- set the locV of sprite dynamicSprite to getAt(getAt(getAt(regionList, i), 2), 2)
- set the memberNum of sprite dynamicSprite to getAt(getAt(regionList, i), 3)
- set the visible of sprite dynamicSprite to 1
- set gButCalled to 1
- do(getAt(getAt(regionList, i), 5))
- set inRegion to 1
- exit repeat
- end if
- end repeat
- if inRegion = 0 then
- set the visible of sprite dynamicSprite to 0
- end if
- else
- set the visible of sprite dynamicSprite to 0
- end if
- end
-