David Passmore
David Passmore

Reputation: 6099

Flash redirect after play

I have a flash document which is an animation of my company logo, it is displayed when loading any of my clients web pages but i need to know how to redirect it to the client's home page after the animation is completed.

Any ideas guys?

Thanks

UPDATE:

I have used a meta refresh for the moment as a workaround for this!

Upvotes: 0

Views: 3372

Answers (2)

David Passmore
David Passmore

Reputation: 6099

I found it you just add an extra keyframe on the end with this action:

stop();

navigateToURL( new URLRequest("*yourpage*"), "_self");

or

stop();

geturl("*yourpage*"), "_self");

Thanks for the help though!

Upvotes: 1

Corey
Corey

Reputation: 5818

Couldn't you just use navigateToURL at the end of the animation? Though, I can't remember if navigateToURL requires user action.

Or, you could use ExternalInterface to call a javascript redirect. I have a function that I use in some cases that looks something like:

function redirectToURL(url:String):void {
    if (ExternalInterface.available) {
        var func:XML = <script>
        <![CDATA[
            function redirect(redirectURL) {
                window.location = redirectURL;
            }
        ]]></script>;
        ExternalInterface.call(func, url);
    } else {
        // external interface is unavailable.
    }
}

It's a bit of a hack, but if you don't have access to the container or JS files...it gets the job done.

Upvotes: 1

Related Questions