PDA

View Full Version : Playing video in a flashmovie


LAMF
05-07-2006, 01:30 PM
How do I play a video in a flash presentation?
I want to add a video (2 min 35 sec long) to a flash presentation.

I have squeezed the video in Sorenson Squeeze and it looks fine in the flv player and all but how do I attach the video to th eflash time line without having it embedded to the flash movie?
I want everyting to play in a loop the total length of the presentation including the video is about 3 min.

Here's the schedule:
Flash presentation (slides) automatically running (12 fps)
after about 350 frames in the time line the video shall start and after the video is finished the flash presentation shall start again to finish the presentation. When everything is finished it shall start from the beginning in an eternal loop... Simple but the problem is the video.flv file.
How do I start it and how do the flashmove continue after the video? :confused:
I need help urgently with this...

Thanks in advance for any assistance...

ikkon
05-07-2006, 02:55 PM
ok ...honestly i never used the presentations lol

but you need to stream the video

you will have to goto the file menu and click import video and a wizard will pop up and you use that for streaming just follow the instructions


then you will need some code

here is some code i use

var myconn:NetConnection = new NetConnection();
myconn.connect(null);

var mystream:NetStream = new NetStream(myconn);

trailer1.attachVideo(mystream);
mystream.play("myvid1.flv");

vidstop_mc.onRelease = function () {
mystream.close();
trailer1.clear();
}

vidplay_mc.onRelease = function () {
mystream.play("myvid1.flv");
}

vidpause_mc.onRelease = function () {
mystream.pause();
}


now you will need a empty movie clip container to place the movie inside it

in this code i also used buttons to control the movie
make sure you use instance names

any more questions let me know

LAMF
05-07-2006, 08:54 PM
Thanks a lot!
I think I hav efound it out myself:
I used this action script on the frame where the movie container is placed.
In my presentation the video clip starts in frame 730 and code is like this:
---------------------------------------------------------------------
var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

thevideo.attachVideo(ns);

ns.setBufferTime(5);

ns.play("themovie.flv");
---------------------------------------------------------------------
This works good enough but it took some time to know exactly when the
time line should reach the end of the video clip so I could put the code

gotoAndPlay(2);

In the last frame of the flash movie that makes it loop eternally!

Is there any other nice ways to make this faster than trial and error as I did in order to find out where the video ends in the time line?
Well well works fine now anyway.