|
-
When Video is complete, goto Frame
Hello all, I have searched the forums and found a few similar posts but none of the solutions worked for me.
I have created a video banner ad (where if you hover over the video it extends downward). I have a movie clip that contains an embedded video instance and actionscript that uses netstream to call the video.
--------------------------------------------------
stop();
//In frame 1 of the main stage of your movie.
app_nc = new NetConnection();
app_nc.connect("rtmp://MY_SERVER_HERE");
NewStream = new NetStream(app_nc);
MyVideo.attachVideo(NewStream);
NewStream.play("Stone_Creek");
function setupStream(nc) {
myStream = new NetStream(nc);
/////
};
---------------------------------------------------------------
On the main timeline I have placed an invisible button over the video so when the video is in its normal state there is no volume and when the users hovers over to extend the video, the volume plays. This code is on the main timeline on frames 1 and 10
---------------------------------------------
// soundholder is a simple movieclip on stage
soundholder.attachAudio(netStream);
audio = new Sound(soundholder);
audio.setVolume(0);
---------------------------------------------
This is all working fine. The part I cant figure out is how to have the movie go to a specific frame when the video is done playing. Do I place the code in the movie clip or on the main timeline? I have tried about three different pieces of AS I found on the boards but none have woeked. Any help would be greatly appreciated.
-
You need to use the NetStream.onStatus function
To detect when the FLV has ended, place this code where you define your NetStream object, on the first frame:
Code:
myStream.onStatus = function(infoObject)
{
// Check if code is Stop. If so video has ended.
if(infoObject.code == "NetStream.Play.Stop")
{
trace("video ended");
}
}
Dene
Last edited by Dene; 08-07-2005 at 07:04 PM.
-
Dene, thanks for the response, I appreciate it.
I define my netstream within the movieclip, so how do I have it go to frame 1 of the main timeline when the video is over? Also, to I place the goto command here?
-----------------------------------------------
myStream.onStatus = function(infoObject)
{
// Check if code is Stop. If so video has ended.
if(infoObject.code == "NetStream.Play.Stop")
{
trace("video ended");
gotoAndPlay(1);
}
}
--------------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|