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

flash actionscript : How to write a script to ask the streaming video (FLV) to do something after it is finised playing...


TKLau
2/14/2007 11:24:12 PM
ggshow
2/15/2007 12:00:00 AM
if you are using FLVPlayback component, you can use the "complete" event.

var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
// insert event-handling code here
};
my_FLVplybk.addEventListener("complete", listenerObject);


TKLau
2/15/2007 3:09:38 PM
It works briliantly. Thank you very much for solving my problems.

_pixel_chick
2/15/2007 5:09:12 PM
I am trying to do something similar, I want it to go to and play a frame, then
load a movie clip when its done without having to click on anything.
ActionScript is not my strong point, so I need a bit of help on this.
TKLau
2/15/2007 5:16:41 PM
_pixel_chick
2/15/2007 11:03:08 PM
Is the FLV component only available in Flash 8. We haven't upgraded yet, we're still on MX 2004. Is there anyway to do it in this version?

TKLau
2/15/2007 11:36:22 PM
I am not sure about MX but I am sure that onComplete event handle is only
avaible on Flash 8.

I have no idea how to solve this issure in MX sorry bcos I am very new in
Flash too...

You must get Flash 8 in my opinion. If you have to solve this issue in very
urgent, I suggest that to embed the clip/ movie in Flash then make it into swf
file so that you can control it with a script.
_pixel_chick
2/16/2007 12:12:49 AM
Yes, we definitely need to upgrade but I don't think I can get a PO through by
tomorrow.

I am trying to load swf files after playing an animation. Right now it looks
like this

on(release) {
goToAndPlay("transition");
}

This works great, but when I add the loadMovie after goToAndPlay, it loads
before its finished playing. Which makes sense. My actionscript skills are
awful so I don't even know where to start to get the swf without an event.
TKLau
2/16/2007 12:56:54 AM
if you just Iwant it to go to and play a frame without having to click on
anything, you just need to embed the entire movie file on the root time line
then adding scripts on the last frame of that time line. You dont need an event
handler.

This is not an ideal way but to solve your deadline by tomrorow.
_pixel_chick
2/16/2007 1:07:35 AM
That sounds great and all, but please excuse my ignorance in all of this. Can you give me an example?
TKLau
2/16/2007 2:36:06 AM
follow the link here to get the fla example which I have just embeded a movie
file straight on the root timeline and then I add another layer for scripting.
look at the last frame of the timeline where I have add a very simple
gotoAndPlay script.

hope ths is what u looking for. otherwise you really need to get flash 8. or
hopefully someone coming along on this forum and solve the MX problem for you.

good luck.


http://www.lauthiamkok.net/scripting_languages/ActionScript/Flash_8/video%20obje
ct/

get this file - embeded video.fla
_pixel_chick
2/16/2007 6:39:50 PM
Thanks TKLau. I downloaded the file and took a look. This is what I'm trying to
do, only in reverse. I want to play some frames, then when they are finished,
load a swf.

Right now my file is set up to play 35 frames, then stops. When the user
clicks, it plays the rest of the frames. When its done with this, I want it to
load a new swf.

Thanks again.
ggshow
2/16/2007 6:46:46 PM
TKLau >
welc:smile;me

_pixel_chick >
ggshow
2/16/2007 6:55:15 PM
[q][i]Originally posted by: [b][b]_pixel_chick[/b][/b][/i]
Right now my file is set up to play 35 frames, then stops. When the user
clicks, it plays the rest of the frames. When its done with this, I want it to
load a new swf.[/q]

just dont add the loadMovie script to your button, add it to the last frame of
your animation
_pixel_chick
2/16/2007 7:06:14 PM
ggshow
2/16/2007 7:13:57 PM
[q][i]Originally posted by: [b][b]_pixel_chick[/b][/b][/i]
How do I load the movie without making the user click or do anything?[/q]

just write the loadMovie script to the last keyframe, like how you write stop
at your frame 35
_pixel_chick
2/16/2007 7:21:40 PM
ggshow
2/16/2007 7:32:35 PM
Rothrock
2/16/2007 7:32:43 PM
PS: There is a Media.complete event that is available in Flash MX04 (AKA Flash
7). Just a suggestion, but you might want to check the help files for
whichever version of Flash you are using. Just a suggestion. :)
AddThis Social Bookmark Button