Skip navigation
dan_steeby
Currently Being Moderated

externalinterface crashing browsers

Jun 29, 2012 5:37 AM

Tags: #externalinterface

Hi,

 

I have a client that wanted a flash slideshow that would go to various pages on her website when clicked.  I'm using externalinterface to call a simple window.location(url, "_self") within the browser.  Half of the time the browser hangs for about 2 seconds and then loads the page.  CPU usage spikes during those 2 seconds so something's going on.  The other half of the time the browser hangs for a while (30 seconds) CPU spike the whole time, and eventually I get the following Unresponsive Script warning:

 

A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

 

Script: resource://firebug/firebug-service.js:4290

 

 

 

I use firebug on Firefox as a debugger for development, but have tried disabling firebug to see if that was the root of the problem, and the problem persists without the plugin installed . . .  This problem is also happening in all the other major browsers.  When firebug IS enabled, I get the following errors in it's console:

 

 

too much recursion

 

jQuery is not defined

 

(the "jQuery is not defined" then is repeated over and over a couple hundred times . . . )

 

Choosing to stop the script doesn't stop the browser from hanging.  Instead the Unresponsive Script warning pops up again after another 30 second hang.  Even if the browser DOES manage to load the page that the window.load() call through the ExternalInterface, the browser continues to hang, even on the next page.  I'm using jQuery on the page to manage some drop-down menues, and it's otherwise not interacting with Flash in any way (the javascript call through ExternalInterface is not using jQuery, the window.open() is a basic javascript function that doesn't need jQuery to run).

 

Any thoughts? 

 

Here is my code:

 

private function stage_clicked(e:MouseEvent):void{ // IF THE CLICK MAKES IT TO THE STAGE, USER IS CLICKING ON AN AD, NOT A BUTTON . . .

     e.stopImmediatePropagation();  // STOP MOUSE CLICK PROPOGATION

     try {

          if (ExternalInterface.available){

               ExternalInterface.call("window.open","www.yahoo.com", "_self");

          } else {

               trace("no external interface available.");

          }

     } catch (e:Error) {

          trace("error: " + e.message);

     }

}

 
Replies
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 30, 2012 12:02 PM   in reply to dan_steeby

    the problem is in your html page or a linked js page.  copy and paste that code.

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 3, 2012 6:25 AM   in reply to dan_steeby

    comment out that call:

     

    ExternalInterface.call("window.open", "http://www.yahoo.com", "_self");

     

    and retest.   same problem?

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 3, 2012 10:20 AM   in reply to dan_steeby

    you have typos in, at least, the 2nd url

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 3, 2012 10:41 AM   in reply to dan_steeby

    am i supposed to click something to see the problem?

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 4, 2012 10:32 PM   in reply to dan_steeby

    i see the problem but am unable to help without investing significant time including downloading your files. 

     

    perhaps someone else can help.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points