home *** CD-ROM | disk | FTP | other *** search
- property numFrames, barLength, barMap, handleChannel, maskChannel, barChannel, startLocH, endLocH, barHideLeft, barHideTop, barHideBottom, handleCast, playing, storedPlaying, theTransitions, movieChunk, thenFrame
- global SoundTracker
-
- on new me, hChannel, mChannel, bChannel, tFrames
- global transitionFrames
- set playing to 0
- set storedPlaying to playing
- set handleChannel to hChannel
- set handleCast to the memberNum of sprite handleChannel
- set maskChannel to mChannel
- set barChannel to bChannel
- set thatFrame to the frame
- set theTransitions to transitionFrames
- if the lastFrame > 50 then
- set movieChunk to the lastFrame / 50
- else
- set movieChunk to 1
- end if
- initBarMap(me)
- initBarHide(me)
- stopTheMovie(me)
- return me
- end
-
- on initBarMap me
- set startLocH to the left of sprite barChannel + 1
- set endLocH to the right of sprite barChannel - 1
- set numFrames to the lastFrame
- set barLength to endLocH - startLocH
- set barMap to [:]
- repeat with i = 0 to barLength
- set whichFrame to i * numFrames / barLength
- if whichFrame = 0 then
- set whichFrame to 1
- end if
- addProp(barMap, startLocH + i, whichFrame)
- end repeat
- end
-
- on initBarHide me
- set barHideLeft to the left of sprite maskChannel
- set barHideTop to the top of sprite maskChannel
- set barHideBottom to the bottom of sprite maskChannel
- end
-
- on progTrack me, nowFrame
- global doTransition
- if not playing then
- soundOff(SoundTracker)
- else
- soundOn(SoundTracker)
- if nowFrame <> thenFrame then
- set thisTransition to getaProp(theTransitions, nowFrame + 1)
- if not voidp(thisTransition) then
- set doTransition to thisTransition
- else
- set doTransition to 0
- end if
- end if
- end if
- if the stillDown and (the clickOn = handleChannel) then
- soundOff(SoundTracker)
- set checkIt to the mouseH
- if checkIt <= startLocH then
- go(1)
- else
- if checkIt >= endLocH then
- go(the lastFrame)
- else
- set tempFrame to getProp(barMap, checkIt)
- go(tempFrame)
- end if
- end if
- else
- if not playing then
- go(nowFrame)
- end if
- end if
- set tempFrame to nowFrame
- set tempLoc to getOne(barMap, tempFrame)
- repeat while tempLoc = 0
- set tempFrame to tempFrame + 1
- set tempLoc to getOne(barMap, tempFrame)
- end repeat
- set the rect of sprite maskChannel to rect(barHideLeft, barHideTop, tempLoc, barHideBottom)
- set the locH of sprite handleChannel to tempLoc
- set thenFrame to nowFrame
- end
-
- on storePlaying me
- set storedPlaying to playing
- end
-
- on resetPlaying me
- if storedPlaying then
- PPButtonPlay()
- else
- PPButtonPause()
- end if
- end
-
- on stopTheMovie me
- pauseMovie(me)
- progTrack(me, 1)
- end
-
- on playMovie me
- set playing to 1
- end
-
- on pauseMovie me
- set playing to 0
- end
-
- on RewMovie me, nowFrame
- set tempFrame to nowFrame - movieChunk
- if tempFrame < 1 then
- go(1)
- else
- go(tempFrame)
- end if
- end
-
- on FFMovie me, nowFrame, eFrame
- set tempFrame to nowFrame + movieChunk
- if tempFrame > eFrame then
- go(eFrame)
- else
- go(tempFrame)
- end if
- end
-