Reply
redirect to URL after SWF is finished playing
Old 02-01-2008, 11:50 AM redirect to URL after SWF is finished playing
Experienced Talker

Posts: 33
hello

I have been given a SWF which I cannot edit but require my webpage to redirect to a URL after the file is finished playing?

can this be done as a parameter of the SWF object or in javascript or by another means?

cheers

paul
69me is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 02-01-2008, 12:03 PM Re: redirect to URL after SWF is finished playing
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Theoretically, it could be done via the built-in setTimeout function and the window.location.href properly, if you can time the length of time it takes to play the Flash file. If you can't edit the Flash file, it would be about the only way to pull this off:

http://www.elated.com/articles/javas...d-setinterval/
http://www.javascriptmall.com/learn/lesson11.htm

That should get you started. Interesting question, though. Definitely not a normal situation. (I like that.)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 02-01-2008, 01:03 PM Re: redirect to URL after SWF is finished playing
Average Talker

Posts: 27
Flash has the ability to call JavaScript functions (or any external code, so long as the code it's calling can interface with Flash), which would allow this to work, but as you've stated that you can't edit the Flash file, this will likely be more problematic.

You could always embed the Flash file into another one, giving you some degree of support for what you want to do.

Using JavaScript timing wouldn't be an overly good idea as your Flash file may take longer for one person to download than another, meaning there's a relatively good chance of the timing going out of sync, meaning the JavaScript may execute before the file is finished playing.

JavaScript can also obtain Flash file information via TGetProperty, but I'm not sure how this works.
You'd need to use it to obtain the progress of the Flash file, meaning you'd be able to detect when the frame count for the movie and the current frame count are the same (meaning the file has played through).
This would require you to check a lot though, so it might do more harm than good unless you're willing to check every few seconds rather than in real time.
Nuvo is offline
Reply With Quote
View Public Profile
 
Old 02-04-2008, 06:57 AM Re: redirect to URL after SWF is finished playing
Experienced Talker

Posts: 33
cool thanks for the advice....thnk ill try putting it within another SWF
69me is offline
Reply With Quote
View Public Profile
 
Old 02-04-2008, 07:45 AM Re: redirect to URL after SWF is finished playing
Novice Talker

Posts: 5
Well you could always set a Meta Refresh allowing time for the flash to load and play, although this is not the best way to do it.

Matt
mattmoo is offline
Reply With Quote
View Public Profile
 
Old 03-07-2008, 07:22 AM Re: redirect to URL after SWF is finished playing
Experienced Talker

Posts: 33
Yeah I put the SWF inside another SWF and that worked just perfect.

Thanks agiain for all the advice!

Regards

Paul
69me is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to redirect to URL after SWF is finished playing
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13293 seconds with 12 queries