home *** CD-ROM | disk | FTP | other *** search
- global cSprites, stageWidth, stageHeight, progressBar, buttonTracker, LabelTracker, PopMenuButton, StopButton, PPButton, FFButton, RewButton, thisFrame, thatFrame, endFrame, playState, hasLabels, thisLine, thatLine, SoundTracker, ccTracker, inTransit
-
- on startMovie
- global doTransition
- set the alertHook to new(script "theAlertHook")
- initData()
- set sendThis to "window size: [" & stageWidth & "], [" & stageHeight & "]"
- externalEvent(sendThis)
- set doTransition to 0
- set endFrame to the lastFrame
- if the text of member "LabelField" = EMPTY then
- set hasLabels to 0
- else
- set hasLabels to 1
- end if
- set cSprites to [:]
- addProp(cSprites, #Background, 109)
- addProp(cSprites, #PopMenuBox, 108)
- puppetSprite(108, 1)
- addProp(cSprites, #ProgBox, 110)
- addProp(cSprites, #PopMenuBtn, 111)
- puppetSprite(111, 1)
- addProp(cSprites, #StopBtn, 112)
- puppetSprite(112, 1)
- addProp(cSprites, #PPBtn, 113)
- puppetSprite(113, 1)
- addProp(cSprites, #FFBtn, 114)
- puppetSprite(114, 1)
- addProp(cSprites, #RewBtn, 115)
- puppetSprite(115, 1)
- addProp(cSprites, #ProgBar, 117)
- addProp(cSprites, #ProgHide, 119)
- puppetSprite(119, 1)
- addProp(cSprites, #ProgHandle, 120)
- puppetSprite(120, 1)
- initControls()
- set playState to #paused
- end
-
- on initControls
- set ccTracker to new(script "ccTrackerMaker")
- set SoundTracker to new(script "SoundTrackerMaker")
- set progressBar to new(script "ProgressBarMaker", getProp(cSprites, #ProgHandle), getProp(cSprites, #ProgHide), getProp(cSprites, #ProgBar), "TransitionFrames")
- set buttonTracker to new(script "ButtonTrackerMaker")
- set LabelTracker to new(script "LabelTrackerMaker")
- set StopButton to makeButton(buttonTracker, "Stop", #off, getProp(cSprites, #StopBtn))
- set PPButton to makeButton(buttonTracker, "Play", #on, getProp(cSprites, #PPBtn))
- set RewButton to makeButton(buttonTracker, "Rew", #on, getProp(cSprites, #RewBtn))
- set FFButton to makeButton(buttonTracker, "FF", #on, getProp(cSprites, #FFBtn))
- if hasLabels then
- set PopMenuButton to makeButton(buttonTracker, "PopMenu", #on, getProp(cSprites, #PopMenuBtn))
- set labelV to stageHeight - 17 - the pageHeight of member "LabelField"
- set the locV of sprite 108 to labelV
- set the visible of sprite 108 to 0
- end if
- end
-
- on onidle
- fakeMouseClicks()
- if not (the stillDown) then
- case thisFrame of
- 1:
- turnOff(StopButton)
- turnOff(RewButton)
- turnON(PPButton)
- turnON(FFButton)
- endFrame:
- turnON(StopButton)
- turnON(RewButton)
- turnOff(PPButton)
- PPButtonPause()
- turnOff(FFButton)
- otherwise:
- turnON(StopButton)
- turnON(RewButton)
- turnON(PPButton)
- turnON(FFButton)
- end case
- end if
- progTrack(progressBar, thisFrame)
- mouseCheck(buttonTracker)
- menuCheck()
- ccCheck(ccTracker)
- set thatFrame to thisFrame
- end
-
- on onenterframe
- set thisFrame to the frame
- end
-
- on onexitframe
- global doTransition
- if doTransition <> 0 then
- puppetTransition(member doTransition)
- set doTransition to 0
- set inTransit to 1
- else
- set inTransit to 0
- end if
- onidle()
- checkSound(SoundTracker, thisFrame)
- end
-
- on PPButtonPause
- if playState <> #paused then
- pauseMovie(progressBar)
- newButtonType(PPButton, "Play")
- set playState to #paused
- end if
- end
-
- on PPButtonPlay
- if playState <> #playing then
- playMovie(progressBar)
- newButtonType(PPButton, "Pause")
- set playState to #playing
- end if
- end
-
- on stopButtonClick
- stopTheMovie(progressBar)
- PPButtonPause()
- storePlaying(progressBar)
- end
-
- on menuCheck
- if the visible of sprite 108 then
- set thisLine to the mouseLine
- if thisLine <> thatLine then
- if thisLine <> -1 then
- set the foreColor of line thisLine of member "LabelField" to the foreColor of field "redField"
- end if
- if thatLine <> -1 then
- set the foreColor of line thatLine of member "LabelField" to the foreColor of field "blackField"
- end if
- end if
- set thatLine to thisLine
- if (thisLine = -1) and the stillDown then
- if not rollOver(108) then
- if not rollOver(111) then
- set the visible of sprite 108 to 0
- end if
- end if
- end if
- end if
- end
-
- on animPause
- if objectp(PPButton) then
- PPButtonPause()
- go(thisFrame)
- end if
- end
-
- on mouseDown
- onMouseDown()
- end
-
- on onMouseDown
- storePlaying(progressBar)
- externalEvent("mouse click")
- end
-
- on onMouseUp
- resetPlaying(progressBar)
- end
-
- on EvalScript xString
- case xString of
- "animPause":
- do(xString)
- end case
- end
-
- on pt xString
- EvalScript(xString)
- end
-
- on fakeMouseClicks
- global lastStillDown
- set thisStillDown to the stillDown
- if thisStillDown <> lastStillDown then
- if not thisStillDown then
- onMouseUp()
- end if
- set lastStillDown to thisStillDown
- end if
- end
-
- on keyDown
- global keyList
- set theKeyCode to the keyCode
- if the controlDown then
- if the optionDown then
- case theKeyCode of
- (the playKey of keyList):
- case playState of
- #playing:
- PPButtonPause()
- #paused:
- PPButtonPlay()
- end case
- (the stopKey of keyList):
- stopButtonClick()
- (the ffKey of keyList):
- nothing()
- (the rewKey of keyList):
- nothing()
- end case
- end if
- end if
- end
-