View Full Version : [F8] Display Link at end of video playback?
cray1000
07-11-2008, 04:56 AM
Hi, i dont know actionscript but i do know some other languages. I basically created some flash flv files and used the importer of flash v8 to add a flvplayback to the files and then published them. but i want to simply show a link at the end of playback. basically i used a non-seek player and want to make sure the viewer watches the whole video before they can take the quiz which is the link they get. i tried using what i found at:
http://livedocs.adobe.com/flash/8/main/00003537.html
but since i know no AS, i am lost. thanks I would appreciate it. Its for a charity i work for.
mike
mylesgrimm
07-21-2008, 02:34 PM
I found this (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00003537.html) on the Adobe site and was able to get it to work without a problem. Inside the function were you see the trace statement, right below it, tell the function what you want it to do at the end of the movie. In my case I told it to "gotoAndPlay(2);" which is telling it to go and play frame 2 and the end of the movie. I then place a "stop();" on frame 2 and place the desired content, in your case a link.
Hope this helps
Myles
The following example uses the playheadTime property to show the elapsed playing time of the FLV file in the Output panel when the complete event occurs.
Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Then add the following code to the Actions panel on Frame 1 of the Timeline:
/**
Requires:
- FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
stop();
import mx.video.*;
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
trace("Elapsed play time at completion is: " + my_FLVPlybk.playheadTime);
/*place command here*/
};
my_FLVPlybk.addEventListener("complete", listenerObject);
my_FLVPlybk.contentPath = "your flv path and name go here";
pelachrum
07-21-2008, 02:44 PM
i don't know if you're using netConnection but if that's the case you could have a function triggered whenever video reaches the end
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream(netConn);
this.attachVideo(netStream);
netStream.setBufferTime(5);
netStream.play("yourmovie.flv");
netStream.onStatus = function(info) {
if (info.code == "NetStream.Play.Stop") {
// some action here that displays your link; attach mc with link in it form library or whatever
}
};
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.