• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 740
  • Last Modified:

Find current frame number of flash movie

I have a director project with qt video where actions are triggered based on specific times in the video (movietime and/or duration). I am updating this project to use flash video instead of quicktime.
 
For ease of development, and hopefully minimal coding changes, I'd like to keep that functionality similar, but I can't figure out how to capture the current frame of the flash movie sprite.

Can anyone help? or suggest an alternative?
0
CABIS
Asked:
CABIS
  • 3
  • 2
1 Solution
 
antonumiaCommented:
assuming your flash video is in channel 1 try

(sprite(1).currenttime / 1000.0) * sprite(1).framerate

that should give you an approximation of the framerate.

currentTime is in milliseconds
framerate is number of frames per second.

sprite(n).duration will give you the length of the clip.

you can also use these with the cast member.
0
 
CABISAuthor Commented:
For QT and AVI files, that would be correct, but in Director 10, currenttime and duration are not  properties available for Flash Movie cast member types.

Is this a new feature of Director 11 (or 11.5)?

While the movie is playing in channel 1, sprite(1).currenttime = 0

0
 
antonumiaCommented:
CyanBlue appeared to be talking about flash video when he was actually talking about a swf movie.

the answer to this is:

flashframe = sprite(flashsprite).getVariable("_root._currentframe", 1)

where flashsprite is the channel number of the flash movie sprite in the score

to maintain this in a variable

flashobj = sprite(flashsprite).getVariable("_root", 0)
put flashobj._currentframe

0
 
antonumiaCommented:
btw:

if you put the flashobj into the object inspector you can see the other properties available e.g.

._totalframes
._framesloaded
etc.
0
 
CABISAuthor Commented:
My fault for abandoning this question. Here's what I ended up with:

The cast member is a flash video in a swf wrapper. The code I found that worked is:

sprite(1).frame                         --current frame
sprite(1).member.framecount  --total frames

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now