home *** CD-ROM | disk | FTP | other *** search
- property ancestor
- property ShutterModeButtons, ClapperButton, ShutterButton
- property theVideo
- property currentSlideID
- property slideHotSpots, images
- property slideBackgrounds
- property frameList, framecount
- property savedClapperPosition, savedShutterPosition, savedImagePosition
- property savedSlideBackgroundPosition
- property savedSlidePositions
- property lastShutterClick
- property slidesets
-
- global pageChannels
- global folderSeparator
-
- on Birth me, theChannelObject, theName, thePageInfo
-
- -- muck around the channel allocator around to give this workshop more channels
- set the ancestor of me to Birth( script "Master Page Template", theChannelObject, theName, thePageInfo, true, true )
-
- set the subject of me to "D1"
-
- set ClapperButton to FindButton( me, "Clap" )
- set savedClapperPosition to the location of ClapperButton
-
-
- set ShutterButton to FindButton( me, "Shu" )
- set the soundname of shutterbutton to "shutter Click"
- set the repeatable of shutterbutton to true
- set the repeatrate of shutterbutton to 60
- set the nowait of shutterbutton to true
- set the immediate of shutterButton to true
- set savedShutterPosition to the location of ShutterButton
- Move( ShutterButton, Point(-100,-100) )
- set lastShutterClick to the ticks
-
- set currentSlideID to 1
- set theVideo to FindDisplay( me, "DecisiveVideo" )
- SetVideoCastName( theVideo, "D1.MOV" )
- Move( theVideo, Point(-1000,1000) )
-
- set savedImagePosition to the location of the image of me
-
- set slideBackgrounds to FindDisplay( me, "Slides" )
- SetInk( slideBackgrounds, #Copy )
- set savedSlideBackgroundPosition to the location of slideBackgrounds
- Hide( slideBackgrounds )
-
- set slideHotSpots to []
- set images to [:]
- set savedSlidePositions to []
- repeat with i = 1 to 10
- set thisImage to FindDisplay( me, "T" & i )
- set thisSlide to FindButton( me, "Slide" & i )
- add( savedSlidePositions, the location of thisSlide )
- SetCastName( thisImage, "T" & i )
- set the name of thisSlide to "Slide"
- SetState( thisSlide, "Disabled" )
- addprop( images, thisImage, the subject of me & "B_001.pic" )
- add( slideHotSpots, thisSlide )
- end repeat
-
- set slidesets to []
- setAt( slidesets, 1, [3] )
- setAt( slidesets, 2, [3, 4] )
- setAt( slidesets, 3, [2, 3, 4] )
- setAt( slidesets, 4, [2, 3, 4, 5] )
- setAt( slidesets, 5, [1, 2, 3, 4, 5] )
- setAt( slidesets, 6, [1, 2, 3, 4, 5, 8] )
- setAt( slidesets, 7, [1, 2, 3, 4, 5, 8, 9] )
- setAt( slidesets, 8, [1, 2, 3, 4, 5, 7, 8, 9] )
- setAt( slidesets, 9, [1, 2, 3, 4, 5, 7, 8, 9, 10] )
- setAt( slidesets, 10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )
-
- ClearSlides me
- Show me
- return me
- end
-
- on SetImages me
- set framecount to count( FrameList )
- if framecount > 10 then set frameCount to 10
-
- if frameCount > 0 then
- SetCastName( slideBackgrounds, "Slide" & frameCount )
- Show( slideBackgrounds )
-
- set thisSlideSet to getat( slidesets, frameCount )
-
- repeat with i = 1 to framecount
- set thisFrame to getat( FrameList, i )
- set thisImage to getpropat( images, getat( thisSlideSet, i ) )
- set thisSlide to getat( slideHotSpots, getat( thisSlideSet, i ) )
-
- set frameStr to string( thisFrame )
- set frameLength to the number of chars in frameStr
- repeat with j = 1 to 3 - frameLength
- put "0" before frameStr
- end repeat
- set theImageName to the subject of me & "B_" & frameStr & ".pic"
- setprop( images, thisImage, theImageName )
-
- set theImageName to the subject of me & "T_" & frameStr & ".pic"
- SetCastName( thisImage, theImageName )
- set the location of thisImage to the location of thisSlide
- Show( thisImage )
- SetState( thisSlide, "Enabled" )
- end repeat
- Move( slideBackgrounds, savedSlideBackgroundPosition )
- end if
- end
-
- on PageIdle me
- PageIdle( the ancestor of me )
- if the playing of theVideo = true then
- if the currentstate of shutterbutton = "Disabled" then
- if the ticks - lastShutterClick > the repeatrate of shutterbutton then
- SetState( shutterButton, "Enabled" )
- if the mousedown = true then
- PageHit( me )
- end if
- end if
- end if
-
- if VideoIdle( theVideo ) = #Stopped then
- Move( ClapperButton, savedClapperPosition )
- Move( ShutterButton, Point(-1000,1000) )
- Move( theVideo, Point(-1000,1000) )
-
- Setimages me
- set currentSlideID to 1
- show( me )
- UpdateButtonBar
- UpdateStage
- end if
- end if
- end
-
- on ClearSlides me
- repeat with i = 1 to 10
- Move( getpropat( images, i ), Point(-1000,0) )
- SetState( getat( slideHotSpots, i ), "Disabled" )
- end repeat
- Move( slideBackgrounds, Point(-1000,0) )
- end
-
- on ResetDecisivePage me
- Move( ShutterButton, savedShutterPosition )
- SetState( ShutterButton, "Enabled" )
- Move( ClapperButton, point(-1000,-1000) )
- Show( ShutterButton )
- Hide( slideBackgrounds )
- Move( theVideo, savedImagePosition )
- ClearSlides me
- updatestage
- set the playing of theVideo to true -- so updatebuttonbar will do the right thing
- UpdateButtonBar
- start( theVideo )
- set framelist to []
- put "reseting video"
- end
-
- on GetState me, buttonID
- if the playing of theVideo = true then
- case ( buttonid ) of
- #Basics, #TeachMes, #GoBack, #ProTips, #RelatedTopics, #Subjects, #Guide, #GoUp, #Subjects, #GoAway, #GoAhead, #Pause:
- return 0
- end case
- else
- return StandardGetState( me, buttonID )
- end if
- end
-
- on ChangePage me, theElementID, theValue1, theValue2
- case theElementID of
- #Subject:
- ClearSlides me
- end case
-
- ChangePage( the ancestor of me, theElementID, theValue1, theValue2 )
-
- case theElementID of
- #Subject:
- SetVideoCastName( theVideo, the subject of me & ".MOV" )
- Move( theVideo, Point(-1000,1000) )
- set theImageName to the subject of me & "B_001.pic"
- set currentSlideID to 1
- setprop( images, getpropat( images, 1 ), theImageName )
- ShowImage( me )
-
- #Image:
- --put "Image change" && theValue1
- set currentSlideID to value(theValue1)
- show( me )
-
- #Shutter:
- Add( FrameList, GetFrameNumber( theVideo ) )
- SetState( ShutterButton, "Disabled" )
- set lastShutterClick to the ticks
-
- #Clapper:
- --put "hit clapper"
- ResetDecisivePage me
- end case
- end
-
- on buildimagename me
- put "currentSlideID" && currentSlideID
- set thisImageName to getat( images, currentSlideID )
- put "thisImageName" && thisImageName
- return thisImageName
- end
-
- on ImportImages SubjectName, startCastIndex, startImageIndex, endImageIndex
- set fileNamePrefix to "Programming:New Art:vollyball:D3_T:"
- repeat with i = startImageIndex to endImageIndex
- set indexString to string(i)
- repeat while the number of chars in indexString < 3
- put "0" before indexString
- end repeat
- set filename to subjectName & "_" & indexString & ".pic"
- importFileInto member startCastIndex of castlib "Decisive", fileNamePrefix & fileName
- put "T" after char 2 of filename
- set the name of member startCastIndex of castlib "Decisive" to filename
- put fileName && the result
- set startCastIndex to startCastIndex + 1
- end repeat
- end