Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : Extracting Time from a loaded Movie



BillinAZ
4/7/2004 8:53:00 PM
Hi,
I need to extract the time, minutes and seconds, from a movie that is being
loaded into a movie clip. On the main stage is an MC called "content_mc".
Various external clips will be loaded into "content_mc" from an array by means
of a menu system. "content_mc" is a 1 frame empty movie. Here is where i'm
starting:

loadMovie("someMovie.swf", content_mc); //this is just test code to fill
"content_mc".
movieFrames= Math.round(this.content_mc._totalFrames/12);
trace(movieFrames)

The trace comes back as 0, since "content_mc" is only one frame. The loaded
movie is approximately 30sec.

Any ideas or suggestions would be most helpful

thx
Laiverd.COM
4/8/2004 2:18:42 AM
If you want to calculate the playtime of a loaded swf you have to wait
before the complete timeline to have loaded before you can access
totalframes. So you're definitely in need of a preloader. Another option
obviously - if you know before how long an swf is, is to simply hardcode it
;-). One thing to be prepared for if you have animations inside a movieclip
that make up for the time, that you obviously have to refer to that timeline
instead of the _root/main timeline of the movie you load.

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

BillinAZ
4/8/2004 9:32:56 PM
I guess that's where i'm lost... How do i create a preloader to read the file
being loaded? I tried using a regular preloader and changing the path to
include "conent_mc" but it doesn't read it still. If i could just figure out
how to do that the rest should fall in line.. i hope :-/
AddThis Social Bookmark Button