Skip to main content
August 12, 2015
Question

I want to go to a web page after my Flash animation ends without having to click on a button. How do I do this?

  • August 12, 2015
  • 1 reply
  • 1681 views

How do I get Flash CS6 12.0.0 on Mac OS X 10.10.4 Yosemite to automatically go to a url web page after my animation is done running.  I have tried the following actions on the last frame but neither one works. Help!

stop();

navigateToURL("http://www.the-roadster-factory.com/1-Icon.php","_self or _blank");

or this

stop();

var request:URLRequest = new URLRequest("http://www.the-roadster-factory.com/1-Icon.php");

     navigateToURL(request, "_self");

This topic has been closed for replies.

1 reply

robdillon
Participating Frequently
August 12, 2015

NavigateToURL() requires a user action. In other words, you need to set this action to occur in response to a user clicking on a button or something similar. You should also consider that it is, usually, bad form to push a user onto a new web site without their asking for that change. In any case, it can be done. Here's a link to some options:http://stackoverflow.com/questions/8804305/opening-a-url-from-flash-using-navigatetourl-as3

August 13, 2015

Thanks for the reply Rob.  I am going to put this flash animation into our dreamweaver created home page, which is a php.  I want the animation to run and automatically connect to another page in our web site when the animation is done. I am not redirecting to another web site.  I have a button for the user to click on on the first key frame in flash which starts the animation.  I was trying to put the code to go to the new web page on the last (key) frame in the animation, without using another button, as I don't want the user to have to click twice to get to this web page.  Can Flash do something like that or am I just wasting my time wanting it to?

robdillon
Participating Frequently
August 13, 2015

Flash can't do what you want directly. Any movement to a new URL through Flash requires user input, like using a button. There are alternatives as listed in the link that I put in the message above. You can use the ExternalInterface call to have Javascript do the work.