homepage Welcome to WebmasterWorld Guest from 54.211.34.105
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Get Flash Movie Duration
How to get the duration of the flash movies through javascript
pkonaje

5+ Year Member



 
Msg#: 437 posted 2:43 pm on Mar 4, 2005 (gmt 0)

I have a webapplication, where I have to display the total display duration of a Flash File. I am using Javascript to read the Flash file properties. Can anybody tell me how we can get Flash file properties like Total movie time in seconds, Flash file height and width in pixels?

Also is it possible to stop the movie after a single loop?

Thank you for your help.

 

Philarmon

10+ Year Member



 
Msg#: 437 posted 1:04 am on Mar 9, 2005 (gmt 0)

I am assuming that you have already figured out how to pass data to JavaScript and you only need to figure that data out in the Flash movie.

The movie duration is stored in the getTime () object:

mytime = getTime ();

Note that the time is in milliseconds, so divide it by 1000 to get seconds:

mytime = getTime ()/1000;

You can get the width and height of the movie like this:

mywidth = Stage.width;
myheight = Stage.height;

Strangely Flash is missing 4 pixels on the width and height, so you have to add tehm up:

mywidth = Stage.width + 4;
myheight = Stage.height + 4;

And finally, to stop the movie at the end, make a keyframe on the last frame (F6) and place a stop () action there.

I hope that helps :)

pkonaje

5+ Year Member



 
Msg#: 437 posted 3:05 am on Mar 9, 2005 (gmt 0)

Thank You... I will try this.

whoisgregg

WebmasterWorld Senior Member whoisgregg us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 437 posted 6:18 am on Mar 11, 2005 (gmt 0)

Thanks Philarmon for posting those helpful actionscript snippets. :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved