Riddlah
Riddlah

Reputation: 302

Force browser to refresh page from flash game

I have flash game which communicate with server. If something goes wrong I want to show popup where will be said. Something is broken press ok button to refresh game.

btnHolder.addEventListener(MouseEvent.CLICK, refreshPage);

private function refreshPage(e:MouseEvent):void
{
...
}

How can I do this ? Is this even possible ? Or max I can do is just show popup with text "refresh your browser".

Upvotes: 1

Views: 1090

Answers (1)

dkasipovic
dkasipovic

Reputation: 6120

You could use ExternalInterface, like:

ExternalInterface.call("document.location.reload", true);

Could that work for you?

Upvotes: 6

Related Questions