|
Quicktime Movie Controllers
Download the sample file
Import a Quicktime Movie
You should know the pixel size, frame rate, and number of frames. Choose File-Import... Select your movie, Click Import.
Select the quicktime movie, Open the Windows->Inspectors->Property Window Choose the quicktime tab Put a check mark next to paused --This will pause the quicktime movie.
Paint Some Objects
Paint a line
Paint a slider Bar
Paint some text, in separate cast members: normal, fast, slow, reverse, stop
Drag the objects into your score
Sprite 1 = quicktime movie Sprite 2 = slider Bar Sprite 3 = line Sprite 4 = normal Sprite 5 = reverse Sprite 6 = slow Sprite 7 = fast Sprite 8 = stop
Make the slider bar moveable in the property inspector, hit the moveable button (1st tab)
Edit the Score Script with Lingo
Double click the first box in the score script. See the diagram below.
A script window will appear. Type the following in the score script.
on exitFrame me put sprite(1).movieTime into member "purpletext" go to the frame end
Edit Each Button with Lingo
Select the button named normal you painted.
Bring up the Window->Inspectors->Property Inspector. Go to the second tab
Hold down the +, select New Behavior Name it normal speed Click the script button in the Property Inspector Type the following script:
on MouseDown sprite(1).movieRate = 1 end
Follow the same procedure for each button:
reverse: sprite(1).movieRate = -1
slow: sprite(1).movieRate = .333
fast: sprite(1).movieRate = 3
stop: sprite(1).movieRate = 0 sprite(2).locH=(sprite(1).movieTime/1.6)+24 -- When the slider is stopped, it moves to the correct frame of the movie. -- line width = 160, movie length = 256 fields 160/256 = 1.6 -- the line is inset 24 unit on the stage
slider bar: on beginSprite sprite(2).constraint = 3 -- Sprite 2 has 0 height, it hides under the visible line. -- I squeezed it in the property inspector. end
on MouseWithin sprite(1).movieTime = (sprite(2).locH -24) * 1.6 sprite(1).movieRate = 0 -- line width = 160, movie length = 256 fields 160/256 = 1.6 -- the line is inset 24 unit on the stage end |