home *** CD-ROM | disk | FTP | other *** search
- on cleanLegos
- global theLegoList
- set theLegoList to [:]
- repeat with i = 1 to 48
- puppetSprite(i, 0)
- end repeat
- end
-
- on mouseDown
- global theLegoList
- if not listp(theLegoList) then
- exit
- end if
- set legoNum to count(theLegoList)
- repeat with i = legoNum down to 1
- set aSprite to getPropAt(theLegoList, i)
- if rollOver(aSprite) then
- set object to getProp(theLegoList, aSprite)
- click(object)
- exit repeat
- end if
- end repeat
- end
-
- on new className, argList
- set newObj to birth(script className, argList)
- setProps(newObj, argList)
- init(newObj)
- return newObj
- end
-
- on setProps me, argList
- if not voidp(argList) then
- set num to count(argList)
- repeat with i = 1 to num
- set prop to getPropAt(argList, i)
- set value to getAt(argList, i)
- if prop = #spriteChan then
- set the spriteChan of me to value
- next repeat
- end if
- if prop = #pressedCast then
- set the pressedCast of me to value
- next repeat
- end if
- if prop = #handler then
- set the handler of me to value
- next repeat
- end if
- if prop = #scrollSprite then
- set the scrollSprite of me to value
- next repeat
- end if
- if prop = #scrollField then
- set the scrollField of me to value
- next repeat
- end if
- if prop = #scrollFieldOut then
- set the scrollFieldOut of me to value
- next repeat
- end if
- if prop = #minButton then
- set the minButton of me to value
- next repeat
- end if
- if prop = #maxButton then
- set the maxButton of me to value
- next repeat
- end if
- if prop = #thumbButton then
- set the thumbButton of me to value
- next repeat
- end if
- if prop = #trackButton then
- set the trackButton of me to value
- next repeat
- end if
- if prop = #scrollLinks then
- set the scrollLinks of me to value
- end if
- end repeat
- end if
- end
-
- on getLilCorral wanderinSprite, corralRect
- set topOffset to the locV of sprite wanderinSprite - the top of sprite wanderinSprite
- set bottomOffset to the bottom of sprite wanderinSprite - the locV of sprite wanderinSprite
- set leftOffset to the locH of sprite wanderinSprite - the left of sprite wanderinSprite
- set rightOffset to the right of sprite wanderinSprite - the locH of sprite wanderinSprite
- set xMin to the left of corralRect + leftOffset
- set xMax to the right of corralRect - rightOffset
- set yMin to the top of corralRect + topOffset
- set yMax to the bottom of corralRect - bottomOffset
- return rect(xMin, yMin, xMax, yMax)
- end
-
- on getBigCorral wanderinSprite, viewRect
- set w to the width of sprite wanderinSprite
- set h to the height of sprite wanderinSprite
- set topOffset to the locV of sprite wanderinSprite - the top of sprite wanderinSprite
- set bottomOffset to the bottom of sprite wanderinSprite - the locV of sprite wanderinSprite
- set leftOffset to the locH of sprite wanderinSprite - the left of sprite wanderinSprite
- set rightOffset to the right of sprite wanderinSprite - the locH of sprite wanderinSprite
- set bigLeft to the right of viewRect - w + leftOffset
- set bigTop to the bottom of viewRect - h + topOffset
- set bigRight to the left of viewRect + w - rightOffset
- set bigBottom to the top of viewRect + h - bottomOffset
- return rect(bigLeft, bigTop, bigRight, bigBottom)
- end
-