Need to add link at end of an .flv movie.

Posted on 2009-04-29
Last Modified: 2013-11-12

I have made a few .flv movies by converting a finished .swf. I'm using a basic flv player that Adobe Flash CS4 included. I'm very new to flash and have had no formal training, which is likely apparent... Basically, I made the flv file, made another swf project that includes the flv player with sources pointing to the website that has the flv file.

The video plays fine now, with controls and such, but now what I need to do is have the video play all the way through and then present a simple link at the end that brings the viewer to another page, sort of like a youtube video provides related videos at the end.

I can't really figure out what I need to do, were this link gets embedded, and how I make it appear only at the end. If anyone has any suggestions, I'd be grateful!
Question by:icarus004
    LVL 2

    Expert Comment

    Just do like this

    myBtn(Instance Name).onRelease = function()
      // Do something. (gotoUrl (

    LVL 8

    Expert Comment

    What you need to do is listen out for the "COMPLETE" event from the FLVPlayback component, which signifies the end of the video. Once you see that event, make your button visible.

    I assume you are using the FLVPlayback component. Give it an instance name of "myVideo" and try the following snippet:
    myVideo.addEventListener(VideoEvent.COMPLETE, onVideoComplete);
    function onVideoComplete(evt:VideoEvent){
    	// make your button visible here
    	// or go to a frame where it is visible

    Open in new window

    LVL 3

    Expert Comment

    Or to simplify it you could just at the stop function on the last frame.
    Make a button and put it action as onClick gotoUrl
    LVL 8

    Expert Comment

    the video runs asynchronously though so the last frame of the SWF doesn't necessarily mean the last frame of your FLV (unless it's directly embedded in the timeline, which you wouldn't do for a video of any real size)
    LVL 2

    Author Comment

    Hi, sorry for the lack of response. I'm learning this as I go along.

    I'm not really so sure the proper way to make a button. I added one from the components window, but going into the actions menu, won't allow me to edit it. Can someone tell me in a little bit more detail how I'd make a button, have it only appear after the video (the video, again is embedded in a swf file. There is only one frame on the timeline) and have it say something like "click here to continue"

    Sorry, as I said, I'm really just trying to do one thing with Flash, so I don't really know anything. Thanks in advance!
    LVL 8

    Accepted Solution

    1. Draw a box (rectangle tool) and put the text on it saying "click here to continue"
    2. highlight both the text and the rectangle and hit F8. In the dialog that comes up, select 'button' from the radio options, give it a name like "my button" and click ok.

    You have now created a button

    Select the new button and in the properties panel, give it the instance name myButton. This identifies the button to your actionscript.

    Put this code on frame 1 - it will listen for the video complete and show the button.  It also assigns a button click handler (just fill in the blanks for what you want it to do) and hides the button at the start.

    // make button visible on video complete
    myVideo.addEventListener(VideoEvent.COMPLETE, onVideoComplete);
    function onVideoComplete(evt:VideoEvent){
    // button click handler
    myButton.addEventListener(MouseEvent.CLICK, function(){
         // button action goes here
    // make the continue button invisible to start

    Open in new window


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
    The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
    The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now