PDA

View Full Version : Select next video at the end of an FLV...


KrushinDreamz
08-04-2009, 05:53 PM
I'm completely new to Flash and this forum, so please take 'er easy! I have spent the last several days on lynda.com and searching the internet for various tutorials and trying to get a crash course in AS3. Here's my question:

I am working on a project with multiple FLV's where the character is traveling along a path, and gets to a certain point where the movie pauses and the viewer selects from several options where the character goes next. It's actually a kayaking going down a river and at each rapid the viewer selects which line he's going to run, but that's irrelevent.

At first, I thought I would do this in one long FLV using cuepoints, where I'd use an event handler to pause the video at a certain cuepoint and display button's presenting the options. The button's would skip the video to the appropriate cuepoint down the line in the video and it would continue. It would be one ridiculously large FLV file though, so I don't think this is the route to go.

Then I realized, I could just chop each "option" or "route" up into smaller FLV's. Then, the character is going and the FLV ends when the viewer is presented with their "choices." At the end of the video, I'd like to have the last frame of the video remain on the screen (simulating a pause) and the options buttons pop up so the viewer can select where the character goes. The button's then link to the appropriate FLV correlating with the viewers selection.

I can't figure out for the life of me how to do this. I tried using:

import fl.video.VideoEvent;

advVid.addEventListener(VideoEvent.COMPLETE, goNext);

function goNext(event:VideoEvent):void
{
nextFrame();
}

stop();

I figured I could put the buttons in the next frame on the timeline, but not sure how I would keep the last frame of the video on the stage. Regardless, it doesn't work and I get an error saying: 1046: Type was not found or was not a compile-time constant: VideoEvent.

Regardless, I feel I'm going about this the wrong way and am looking for a little direction. Thanks for taking the time to read this wordy post!

Confus
08-04-2009, 07:15 PM
var video:Video = new Video(500,500);//size
addChild(video);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
video.attachNetStream(ns);
ns.play(“test.flv”);

plenty tutiorials for that

KrushinDreamz
08-04-2009, 07:33 PM
I understand all that, I have that in my own class I created called AdvancedVideo. I can place the video no problem, what I'm wondering is how do I make the video pause and present options which will dictate how the video will proceed?

Thanks,
Will

Confus
08-04-2009, 07:38 PM
just do Stop(); on the frame u want to display choices
and create buttons you need, then make MouseEvent.CLICK listeners on each button and make that event load movie you want.

KrushinDreamz
08-04-2009, 07:59 PM
How do I do the stop(); function on the frame I want if the video is all controlled with ActionScript in 1 frame? When I said I wanted the video to pause on the last frame, I should have been more specific I guess. I mean the last frame of the FLV file, or MOV file, the last video frame, not flash frame.

I thought I should use streaming video, should I embed the video in the fla file?

Thanks

KrushinDreamz
08-04-2009, 09:09 PM
Here's my code, what am I missing?

import fl.video.VideoEvent.*;

var pathVideo:String = "test1.flv";

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

var videoStream:NetStream = new NetStream(videoConnection);
videoStream.bufferTime = 3;



var video:Video = new Video (576, 324);
video.attachNetStream(videoStream);
videoStream.play(pathVideo);

addChild (video);

video.addEventListener(VideoEvent.COMPLETE, nxtFrm);

function nxtFrm(event:VideoEvent):void
{
nextFrame();
}

KrushinDreamz
08-06-2009, 04:55 PM
Is there no other advice for this?