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

flash actionscript : after playing flv jump back to frame 1



firewireflow
4/20/2007 7:06:11 PM
hey

i'm not a frequent flash user ... so its driving me crazy ... i have a
startscreen on frame with a button that jumps to frame 2. on frame 2 is a flv
vid ... and now i want that after the flv vid reached its end its jumping back
to frame 1 ... i did a lot of reasearch on the net and cant figure it out ... i
have no experience with actionscript and so on ... the only thing i found out
is that i need to use cue points! any help is very appreciated !!!!! thanks a
milllions times!

best
flow
GWD
4/20/2007 7:32:01 PM
Are you using the FLVPlayback component? Is so, then just listen for the
complete event .You won't need cue points if its the end of the video only.

If your FLVPlayback component is called [b]myFLVPlayback[/b], then on frame 2
try the following code:

var myFLVListener = new Object();
myFLVListener.complete = function(evtObj) {
//this will execute when the video reaches its end
_root.gotoAndStop(1)

}

myFLVListener.addEventListener("complete", myFLVListener);


firewireflow
4/20/2007 8:08:05 PM
hey gwd

thanks for your quick response ... yes, i'm using the FLVPlayback component,
but unfortunately your coede doesn't work ... its freaking me out ... i also
tried to execute other events (getURL, ...) to make sure ... but nothing
works...

its driving me crazy!!!
GWD
4/22/2007 1:28:45 PM
Sorry - I just checked back and saw your reply.

It should work if you have the FLVPlayback component correctly named in the
properties panel. You need to make sure its called myFLVPlayback or if you have
a different name, then you could change the last line of the code and make sure
your name is at the beginning.

I presume there is also a stop() action in the timeline on frame 2?

If everything above is as it should be then the only other thing I can think
of is if the metadata in the flv is not correct for some reason. If you think
this is possible then a freeware tool called FLVMDI (google) might help correct
this.

AddThis Social Bookmark Button