Search code examples
createjs

Flash CreateJS navigate to URL on enter last frame


I have an anim created in Flash CS6 and exported using CreateJS framework. The only thing I need is for the animation to redirect the browser to another URL when the anim completes.

In AS3 this does what I need just fine:

navigateToURL(new URLRequest("http://mywebsite.com/choose.php"), "_self");

For the CreateJS version I have tried this with no luck (maybe my function name is wrong?):

/* JS
this.onEnterFrame = function() {
    window.location = "http://mywebsite.com/choose.php";
}
*/

Also, have do I get the CreateJS version to open the new URL in _self window (same domain).


Solution

  • Remove this.onEnterFrame = function(){ } and change window to document. It should look like the following:

    /* js
    this.stop();
    document.location = "http://www.google.com";
    */