Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Director QT Movies Control without the Control Bar

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm having some trouble (read: I don't know enough Lingo) putting together a script that would allow a Quicktime movie to play when clicked upon (in a held frame). Then if clicked upon again, it would pause, and once more it would continue. At the end of the movie it should require one more click to go back to the beginning.

The problem with this is, that there will be no control bar. The control bar skews the movies too much to be useful. Thus, I need some sort of code to impliment this. So, if anyone knows if this is possible or has some coding tips, they would be greatly appreciated.

Thank you!

- Movietrouble
 
First, create a movie script with two global variables:

global gPause
global gPlay

on prepareMovie
set gPause=1
set gPlay=0
end


Then on the sprite you will use as your button put a behavior with this script:

global gPause
global gPlay

on mouseDown
set gPlay=gPlay+1
if gPause=1 then
sprite(1).movieRate = 1
set gPause=0
end if
if gPlay=2 then
sprite(1).movieRate = 0
set gPlay=0
set gPause=1
end if

end

This works for me as a play/pause toggle, i believe when the video plays to the end and stops, it should play again if you hit the button again twice.

So to get the video to play back once you hit the button once you will have to temporarily activate the QuickTime Control, play the movie and scroll to its end, now in the Message Window type this:
put sprite(x).movieTime x being the sprite of your QuickTime video. then press enter if should give you back a number Y.

Now the code on your control button should be
global gPause
global gPlay

on mouseDown
set gPlay=gPlay+1
if gPause=1 then
sprite(1).movieRate = 1
set gPause=0
end if
if gPlay=2 then
sprite(1).movieRate = 0
set gPlay=0
set gPause=1
end if
if sprite(1).movieTime=Y then
sprite(1).movieRate=1
end if
end

Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top