ActionScript - Click and Go to URL, Open on current tab

user1944305 picture user1944305 · Apr 21, 2013 · Viewed 7.9k times · Source

I have created a flash animation with actionscript (which I don't know very much about) and I've converted it to html5 with swiffy.

I was wondering is it possible that when a "click and go to web page" button is clicked that the URL is opened in the current tab and not a new one? I've tried googling it and nothing comes up.

This is the actionscript as it appears in flash.. I'll spare you the code swiffy generates!

forumgo.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);

function fl_ClickToGoToWebPage(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.adobe.com"), "_blank");
}

Answer

RafH picture RafH · Apr 21, 2013

Change the "_blank" to "_self", it should work when converted.

navigateToURL(new URLRequest("http://www.adobe.com"), "_self");