home *** CD-ROM | disk | FTP | other *** search
- on initializationRoutines
- global purgeLevel
- set purgeLevel to 500
- initLists()
- setAnimationSpeed()
- end
-
- on idle
- processList()
- end
-
- on processList
- global nextList, nextPtr, idleFlag
- if idleFlag = 1 then
- if nextPtr <= count(nextList) then
- set nCast to getAt(nextList, nextPtr)
- set ok to 0
- if voidp(nCast) = 0 then
- if integerp(nCast) = 1 then
- if the castType of cast nCast <> #empty then
- set ok to 1
- end if
- else
- if the number of cast nCast <> -1 then
- set ok to 1
- end if
- end if
- end if
- if ok = 1 then
- preLoadCast(nCast)
- end if
- set nextPtr to nextPtr + 1
- end if
- end if
- end
-
- on initLists
- global currentList, nextList, nextPtr, idleFlag
- set purgeList to []
- set currentList to []
- set nextList to []
- set nextPtr to 1
- set idleFlag to 1
- end
-
- on startList pCast
- global currentList
- append(currentList, pCast)
- end
-
- on newList
- global currentList, nextList, nextPtr
- unloadPurgeList()
- repeat with i = 1 to count(nextList)
- append(currentList, getAt(nextList, i))
- end repeat
- set nextList to []
- set nextPtr to 1
- end
-
- on unloadPurgeList
- global currentList, purgeLevel
- if the freeBytes < purgeLevel then
- repeat with i = 1 to count(currentList)
- set nCast to getAt(currentList, i)
- unLoadCast(nCast)
- end repeat
- end if
- set currentList to []
- end
-