Solved

GotoURL at end of FLV embedded in SWF

Posted on 2009-05-18
9
894 Views
Last Modified: 2012-05-07
Hi all,

I have a simple one frame swf that is playing back an FLV file, via the built-in Flash video player component  (Flash CS3). That swf is then embedded into a HTML page.

When the FLV is finished playing, I want to load a new HTML page.

I've seen post to "add the open URL tag on the last frame" but this obviously doesn't work well, because the embedded FLV will never finish exactly on the same frame.

Also, I believe I may have to make some changes to the HTML code to get around newer Flash security features.

THanks - Cory
0
Comment
Question by:stonerome
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 16

Expert Comment

by:s8web
ID: 24413265
you will have to create an event cue point at the end of your flv.

 (http://livedocs.adobe.com/flash/9.0/flvencoder/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_NoParts&file=FLV_25.html)

Then add actionscript to your swf that listens for that cue point and then does something (in this case, geturl) based on the name of the cuepoint:

var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
      getURL("yoururlhere.com");
      trace("endcue: " + eventObject.info.name);
      trace("endcue: " + eventObject.info.type);
}
yourmovienamehere.addEventListener("cuePoint", listenerObject);
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 24414737

here is a solution for AS 3.0:

http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_24322811.html


basically, you are looking for the onStatus event handler to return "NetStream.Buffer.Full"...  


rp / ZA
0
 

Author Comment

by:stonerome
ID: 24415803
I've added a cue point to the flv , named
end_cue

I'm not sure what I need to modify in your code (aside from the getURL).

My movie name...is the the name of the swf that will have this action in it? If so, that name of that is intro.swf.

Thanks for the help -

var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
      getURL("yoururlhere.com");
      trace("endcue: " + eventObject.info.name);
      trace("endcue: " + eventObject.info.type);
}
yourmovienamehere.addEventListener("cuePoint", listenerObject);
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:stonerome
ID: 24415862
I put this in, and it's not working, but I'm guessing I'm not doing something right:


var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
      getURL("http://www.google.com");
      trace("end_cue" + eventObject.info.name);
      trace("end_cue" + eventObject.info.type);
}
intro.swf.addEventListener("cuePoint", listenerObject);

Open in new window

0
 
LVL 22

Expert Comment

by:rascalpants
ID: 24416019


just use this instead...


rp / ZA





import mx.utils.Delegate;
 
// stream_ns is the instance name of your NetStream
 
stream_ns.onStatus = Delegate.create(this, checkStatus);
 
function checkStatus( info:Object ):Void
{
   if (info.code == "NetStream.Buffer.Empty")
   {
      getURL("http://www.google.com");
   }
}

Open in new window

0
 
LVL 16

Accepted Solution

by:
s8web earned 500 total points
ID: 24416028
My bad,

intro.swf.addEventListener("cuePoint", listenerObject); should be

nameofyourflv.addEventListener("cuePoint", listenerObject);
0
 

Author Closing Comment

by:stonerome
ID: 31582639
Thanks that worked - to the other expert that offered a solution, thanks. But I should have told you I wasn't looking for AS3
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 24416453

the last comment posted was in AS 2.0...  hence the use of the Delegate Class...

which in AS 3.0 is no longer needed...


glad you got somethin workin for ya.




rp / Zone Advisor
0
 

Expert Comment

by:wendArnold
ID: 25071466
I have a similar issue and am a bit of a novice when it comes to flash and flash video. I have the flv files with cue points at the end of them. I want to add action script to these in flash so that it will redirect to a URL as soon as the video is complete.  I am confused about where to add the actionscript.  Do I add it to the video itself (this is not working) or to the next key frame.  I continue to get errors with the code above saying that it has to bee applied to onClipEvent handler.  What am I doing wrong?
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Flash Player White Screen Facebook 5 798
FlashBuilder allocate more memory using FlashBuilder.ini 18 298
Web browser crash when play videos 24 458
Adobe Indesign CS6 4 165
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

734 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