homepage Welcome to WebmasterWorld Guest from 54.167.10.244
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

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




msg:1566059
 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




msg:1566060
 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




msg:1566061
 3:05 am on Mar 9, 2005 (gmt 0)

Thank You... I will try this.

whoisgregg




msg:1566062
 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