Skip to main content
December 2, 2010
Answered

No access to cue-points

  • December 2, 2010
  • 1 reply
  • 988 views

Hi

I have added an flv-playback instance to the stage in Flash CS4. The flv has some cuepoints named "01" - "10". The cue-points were set in AfterEffects CS4. There's some event- and some navigation-type cuepoints. I now attempted the simple task of getting a specific cuepoints' time using actionScript. Easy enough one should think, but apparently it isn't. All examples, regardless where I found them suggest using a method like this:


var vidPlayback = this.bMovie; // bMovie is the instance-name of the flv on the stage
trace(vidPlayback);                 // "[object FLVPlayback]"

var someCP:Object = vidPlayback.findCuePoint("02");
trace(someCP);                     // "null"

Why on earth is the cuepoint not found, when it's definitely there? I tried next to use the metadata-object, to see if I could get the time from there, using

for(var i=0; i<vidPlayback.metadata.cuePoints.length; i++)
{               
    trace("cuepoint ["+i+"] : name="+vidPlayback.metadata.cuePoints.name+" time="+vidPlayback.metadata.cuePoints.time);
}

This however throws an exception, as the metadata-property apparently is null as well. What the heck is going on?

This topic has been closed for replies.
Correct answer Andrei1-bKoviI

Maybe because video is not loaded to this point yet? Flash can see only what is loaded.

1 reply

Andrei1-bKoviICorrect answer
Inspiring
December 2, 2010

Maybe because video is not loaded to this point yet? Flash can see only what is loaded.

December 7, 2010

That was it.

I can't believe Flash got me on that one again.....

Still, it's very inconvenient to have to wait for every damn thing, even when loading local resources. Forces poor devs like me to rip apart our "clean" and readable functions into a mess of event-listeners and according event-functions (to which you can't even pass parameters other than the event-object).

Inspiring
December 7, 2010

" it's very inconvenient to have to wait for every damn thing, even when loading local resources."

This is the reality. Especially on Internet nothing can happen instantaneously and in sync. And it is not about Flash only.

What would be an ideal scenario in your view?

" according event-functions (to which you can't even pass parameters other than the event-object)."

Yes you can - you just need to write your own custom event that accepts additional parameters.