Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE DIRECTOR:HomeDirector ForumTagMotion Graphics

How to: When QTime Movie stops jump to marker?

COW Forums : Adobe Director

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
jasongreenoHow to: When QTime Movie stops jump to marker?
by on Aug 31, 2007 at 6:51:13 pm

I'm trying to finish this one simple element of my Director project and I've been here all day.

My project has 1 intro movie and 5 topic movies. After the intro plays the playhead stops at the Menu Page. When a button is pushed the playhead jumps to the topic movie. I don't know how to make the playhead jump back to the menu after the movie finishes.

I tried:

on exitFrame me
if sprite(1).playing = true then
go to the frame
else go to "test"
end if
end

but got the error:

Script error: Property Not Found
if sprite(1).playing = true then

#playing



Return to posts index
Reply   Like  

Brodd NessetRe: How to: When QTime Movie stops jump to marker?
by on Sep 3, 2007 at 7:31:26 am

What the error message tells you is that this property ("playing") isn't valid for the type of sprite you have. Playing is valid only for Flash sprites, while you say you're using a Quicktime movie. The relevant property to use here is movierate. This will work:

if sprite(1).movierate = 0 then --i.e. stopped

This confusion could probably be avoided, but for now it is how it is. Remember that in any scriptwindow you have dropdown menus where all Lingo terms are sorted as to where they will have a function, i.e. all valid Quicktime properties are found under Quicktime member / Quicktime sprite, and similar for Flash member / sprite. This is a great tool for both beginners and people like me who suspect ..... (can't remember) .... Alzheimer is kicking in early this fall.


Return to posts index
Reply   Like  

bouke vahlRe: How to: When QTime Movie stops jump to marker?
by on Sep 3, 2007 at 10:27:41 am

Not quite true...
Sprite(1).movierate will stay 1 if the movie ends by itself.

Better is,
if sprite(1).movietime > sprite(1).duration - 20 then

Mind the - 20.
This is to avoid the 'off by one' bug.
It's not guaranteed that the exact last point will be played, so this is just for safety.
As movietime is measured in ticks (60 per second) this will kick in 1/3 of a second before the actual end.

You can make it a little smaller, but safer is this and have the application wait a little before taking furter action.






Bouke

http://www.videoToolShed.com
smart tools for video pro's


Return to posts index
Reply   Like  


jasongreenoRe: How to: When QTime Movie stops jump to marker?
by on Sep 4, 2007 at 10:36:54 am

Thanks for the help guys...


When I implement the code below the playhead jumps before the movie is complete. Is "go to the frame" not the correct way to say "stay here"?

on exitFrame me
if sprite(1).movietime > sprite(1).duration - 20 then
go to the frame
else go to "test"
end if
end


Return to posts index
Reply   Like  

jasongreenoRe: How to: When QTime Movie stops jump to marker?
by on Sep 4, 2007 at 11:02:13 am

It seems like the problem originates from the sprite's track length? It is my understanding that the track can be as short as 8 frames long providing that there is a script telling it to keep playing (like Hold on Current Frame). Is this no true? Should I be working with the "actual" lengths of each sprite?


Return to posts index
Reply   Like  

jasongreenoRe: How to: When QTime Movie stops jump to marker?
by on Sep 4, 2007 at 11:42:05 am

on exitFrame me
if sprite(2).movierate > 0 then
go the frame
else go to "welcome"
end if
end


This code seems to do what I need. Note: I use sprite(2) because my sprite is in channel 2.


Return to posts index
Reply   Like  


jasongreenoRe: How to: When QTime Movie stops jump to marker?
by on Sep 4, 2007 at 12:21:35 pm

ah crap...

By using the frame rate = 0 to cause the playhead to jump, that messes up the Pause feature of my controls.

How can I allow the user to pause/play the quicktime movie AND still keep the functionality of the above code?


Return to posts index
Reply   Like  

Brodd NessetRe: How to: When QTime Movie stops jump to marker?
by on Sep 4, 2007 at 7:22:55 pm

Bouke was on to something in his suggestion, but you could try and reduce the number after the minus sign, i.e

vD = member("myVideo").duration
if sprite(2).movieTime > vD -5 then
go "somewhere"

Note that you should NOT use movieTime = duration, as very often the movie will stop just short of its full length (I can explain if you like, but...). With the minus number you make a little cushion there at the end, but if you make it too large, you will indeed see it jump too early.

As for your other questions:

In Director you need only one frame actually, for any movie in any length. Five to ten frames is more common, simply becauce the Score looks tidier.

There's nothing wrong with having your scirpt within the on ExitFrame handler, but it is concidered good practice to have the main block of the scripting inside the on enterFrame handler instead, with only the go to the frame command inside on exitFrame. It's tidy too, but the real reason is that Director allocates a little more time to the on enterFrame handler, so at least long and complex frame scriptiong should definetly be placed there.


Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2013 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]