all groups > flash actionscript > october 2005 >
You're in the

flash actionscript

group:

End of FLV to new SWF file


End of FLV to new SWF file dtjenks
10/4/2005 8:38:35 PM
flash actionscript:
Hi,
Using some of the existing behaviors, I have linked a FLV video into an
existing flash file. I am trying to link to another separate swf file from the
end of the FLV file. I understand that I probably have to use the listening
code, but I am uncertain how to tie these together. Can someone please assist.
Thank you.
Re: End of FLV to new SWF file myIP
10/5/2005 12:00:00 AM
The code below plays a FLV (that is 1.5 seconds long) and when it has ended
will loadMovie( ) a SWF. The FLV needs a video object on stage to be viewed.
In the Library panel right click on the top right corner and select ?New
Video?. Drag the video on stage with an instance name of ?streamHolder_video?.
You also need to create a cue point in the FLV with Flash 8 Video Encoder (I am
not sure how else to embed cue points). When you do this under the Advance
Setting set your cue point (?event?) at the end of the FLV and on the right of
the panel under ?Parameters? create a name called ?keypoint? and give it a
value of 1.5. Then have the FLV and SWF in the same directory as the FLA and
it should work.
If you don?t have Flash Encoder or want to try a different way of
accomplishing this, you might want to look up:

onStatus (NetStream.onStatus handler)

in the livedocs (F1 in Flash). This has a NetStream.Play.Stop status that
should work, however I currently just use cue points to do the job.

//setting up FLV(stream) object
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
streamHolder_video.attachVideo(stream_ns);

//setting up SWF(movie) object
_root.createEmptyMovieClip("movieHolder", 200);
movieHolder._x = 58;
movieHolder._y = 205;

//play FLV
//***NOTE THIS FLV ONLY HAS 1.5 SECONDS
stream_ns.play("firstmovie.flv");

//listen for cuePoint in FLV
stream_ns.onCuePoint = function(infoObject:Object)
{
for (var paramName:String in infoObject.parameters)
{
trace(" " + paramName + ": " + infoObject.parameters[paramName]);
if(infoObject.parameters[paramName] == 1.5)//if it is == then FLV has ended
loadMovie("secondmovie.swf","movieHolder");
}
}
AddThis Social Bookmark Button