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!

Detect AVI stop

Status
Not open for further replies.

starrytwinkle

Technical User
Dec 23, 2002
28
SG
How can i detect if an avi has stopped so i can go to the next marker?
thanks.
 
Hi,
You can get the AVI's duration and playing time using:
duration and movieTime

If movieTime = duration means the movie has reaches the end.
The script will be something like this:
----------------
on enterframe me
pTime = sprite(x).movieTime - 60
pDuration = sprite(x).duration
if pTime = pDuration then do something
end
----------------
 
Thank You. I tried it but then it still stops halfway. But then it will continue to play if I have more sprites. Do I need to fit the number of sprites according to the length? In that case, If a comp is slower then the clip will not finish playing at all. Thanks.
 
Is your sprite number correct?
It is more secure if you attach the script in your avi sprite.
Then, instead of using sprite(value), use:
sprite(the currentSpriteNum).

I tried adjusting the tempo and framerate, and it works fine for me.
 
the "movieRate" property is much more reliable.
put sprite(whichSprite).movieRate
Returns 1 or 0 depending on if the movie is playing or not.

Mayuresh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top