?
Solved

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

Posted on 2009-04-29
6
Medium Priority
?
1,271 Views
Last Modified: 2013-11-12
Hello,

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!
0
Comment
Question by:icarus004
6 Comments
 
LVL 2

Expert Comment

by:viral_sonawala
ID: 24264872
Just do like this

myBtn(Instance Name).onRelease = function()
 {
  // Do something. (gotoUrl (_www.google.com)

};
0
 
LVL 8

Expert Comment

by:ccarey
ID: 24266476
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

0
 
LVL 3

Expert Comment

by:mharfouch
ID: 24266856
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
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 8

Expert Comment

by:ccarey
ID: 24267082
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)
0
 
LVL 2

Author Comment

by:icarus004
ID: 24275131
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!
0
 
LVL 8

Accepted Solution

by:
ccarey earned 2000 total points
ID: 24275171
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){
    myButton.visible=true;
}
 
// button click handler
myButton.addEventListener(MouseEvent.CLICK, function(){
     // button action goes here
});
 
// make the continue button invisible to start
myButton.visible=false;

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses

864 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