mema82
mema82

Reputation: 1

External page link using actionscript

I have a 2 frame movie clip. When I click on the first image it goes to the second image just as I want it to be. But I want the second image, once it shows up, to stop for 1 second then go to an external url. Is this possible with Actionscript?

Example of what I am looking for:

Frame 1: Click here for frog to hop , once clicked goes to frame 2.

Frame 2: Frog hops then an external page opens up such as www.froggers.com

Upvotes: 0

Views: 74

Answers (1)

putvande
putvande

Reputation: 15213

You can use a setTimeout and navigateToURL (put it on the second frame):

setTimeout(function():void {
    navigateToURL(new URLRequest('http://www.google.com'));
}, 1000); 

Where 1000 is 1 second and you could specify a second parameter in the navigateToURL setting the target, like _blank if it needs to open in a new window.

And to get on the second frame do something like:

image.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void {
    gotoAndStop(2);
});

Upvotes: 1

Related Questions