FORUMS: list search recent posts

going insane - using AS3 in Flash- stop flv at cuepoint, and change frame at end of video.

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jon Draper
going insane - using AS3 in Flash- stop flv at cuepoint, and change frame at end of video.
on Mar 18, 2010 at 4:17:55 pm

Good afternoon,
Ok after a good 4 hours trying different forum advise I give up. I'm working in Action Script 3 in Flash. Admittedly I know AS2 a bit better I needed the caption function available in AS3.

Ok, so I'm now stuck...

(For ease I will simplify my setup)
I have 3 FLVs playing in individual FLV Playback components on different frames,

I've added a cuepoint using flash component inspector at 1 minute. (it is not embedded in the FLV). I called the cuepoint 'stop'.

Can someone tell me how to tell flash to pause when it reaches this cuepoint.

I've tried advise on this forum but it all relates to embedded cuepoints in the FLV's which I don't want to do, as the videos are liable to be change.

I have one layer with AS3 code for some buttons,

Should I be adding code in with the button code, or to a keyframe on the same frame as the flvplayer.

Also how to change frame when I reach the end of the FLV...

please assume I know nothing, as I'm not up todate with Flash coding.

Return to posts index

demetri tashie
Re: going insane - using AS3 in Flash- stop flv at cuepoint, and change frame at end of video.
on Mar 18, 2010 at 5:30:36 pm

since you seem so new to AS3, i won't tell you why you probably don't want to do this on a timeline, and why not to put code on separate frames.

besides that, though, i would never add a cue point via the component inspector. it jsut seems to buggy that way. ideally you embed them upon encoding, as that way you can ensure accuracy. barring that, add them with actionscript. there are 2 methods to choose from - adding them using a cuepoint object, or more simply with addASCuePoint() method. for simply creating a cuepoint at a choosen time and giving it a name, this second way is simpler.
however using the cuepoint object allows for adding paramaters also.

so - make sure you import the right classes ( VideoEvent and MetadataEvent). then attach a cue point to the instance name of the FLVPlayback component, then add a listener to the component to carry out whatever you want. ( it listens for the Metadata)

another listener and function will listen for a VideoEvent that upon the video COMPLETE, it can carry out another function.

the code has to be on the same frame as the videoplayer it is referencing.



flvPlayer.addASCuePoint(5,'cue2'); // a second cuepoint. you can add as many as you want

flvPlayer.addEventListener(MetadataEvent.CUE_POINT, cueFunction1);
function cueFunction1(evt:MetadataEvent):void{
if( == "cue1"){ do something;}
if("cue2"){ do something else;}

flvPlayer.addEventListener(VideoEvent.COMPLETE, completeFunction);
function completeFunction(evt:VideoEvent):void{ does something else;}

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved