Friday 16 September 2011

Need Adobe Flash CS3 help. How do I put a link in my video once it has stopped playing?

I am using Adobe Flash CS3 and have just completed a movie. What I want it to do is once it has finished playing, have the URL on the page change to my main page. How do I go about doing this? (my flash is on index.htm and I want it to change to index2.htm) Also, the video loops over and over again. If I have the weblink added, will this stop?



ThanksNeed Adobe Flash CS3 help. How do I put a link in my video once it has stopped playing?This is a little complicated - you need to add a listener or insert a queue point to tell your player what to do. I'm going to tell you how to do this with queue points, because it's a little more flexible. (This is assuming you're using the FLVPlayback component and AS 2.0) First, insert this code into a keyframe in the frame that you're playing your video on:



var cuePt:Object = new Object();

cuePt.time = 000;

cuePt.name = %26quot;end%26quot;;

cuePt.type = %26quot;actionscript%26quot;;

vid.addASCuePoint(cuePt);



var listenerObject:Object = new Object();



listenerObject.cuePoint = function(eventObject:Object):Void {

gotoAndPlay(2);

};

vid.addEventListener(%26quot;cuePoint%26quot;,listen鈥?br>


listenerObject.complete = function(eventObject:Object):Void {

gotoAndPlay(2);

};

stop();



A few things to note: %26quot;cuePt.time%26quot; is the length of your video in seconds. You'll want to change this according to how many seconds long your video is. Also, there are several places where the AS says %26quot;gotoAndPlay(2)%26quot; Change the number 2 to the keyframe number that your video is on everywhere it says this.



Lastly, add a keyframe directly after the one your video is contained in. (ie. if your video is in frame 2, add a blank keyframe at frame 3.)



Insert this AS code into that keyframe:



getURL(%26quot;www.index.com%26quot;);



Be sure to change the url inside the quotes to EXACTLY the url you want people to be sent to.



That's it! Hope this works - cheers!



ps. the looping video is an FLVPlayback component parameter (again assuming you're using it). Go to the keyframe your movie is in, select the player, and then go to your parameters tab at the bottom of the screen. Change %26quot;autorewind%26quot; to false, and this should stop the loop.