Posted By

sherakama on 12/03/09


Tagged

textmate popup flash click banner as3 blocker


Versions (?)

Flash popup blocker banner mouse click bypass


 / Published in: Other
 

  1. /**
  2. * Utility function to wrap up changing pages. Avoids over-aggressive popup blockers.
  3. * @param url The URL to change to. Either a String or a URLRequest
  4. * @param window The target browser window/tab, generally _self, _top, or _blank
  5. * @usage URLNavigator.ChangePage("http://www.google.com", "_blank");
  6. **/
  7. public static function ChangePage(url:*, window:String = "_self"):void {
  8. var req:URLRequest = url is String ? new URLRequest(url) : url;
  9. if (!ExternalInterface.available) {
  10. navigateToURL(req, window);
  11. } else {
  12. var strUserAgent:String = String(ExternalInterface.call("function() {return navigator.userAgent;}")).toLowerCase();
  13. if (strUserAgent.indexOf("firefox") != -1 || (strUserAgent.indexOf("msie") != -1 && uint(strUserAgent.substr(strUserAgent.indexOf("msie") + 5, 3)) >= 7)) {
  14. ExternalInterface.call("window.open", req.url, window);
  15. } else {
  16. navigateToURL(req, window);
  17. }
  18. }
  19. }

Report this snippet  

You need to login to post a comment.