Skip to main content
Inspiring
March 23, 2009
Question

JavaScript / ExternalInterface Proximity?

  • March 23, 2009
  • 2 replies
  • 451 views
Hi all,
I've been trying to hit a JS function from the last frame of my SWF using ExternalInterface and it doesn't work when it lives in an external JS file. When the function is in-line with the HTML the function is exposed to ExternalInterface.
Is this the rule? Can ExternalInterface not see external JS functions?

Ultimately I'm trying to defeat the early window.onload javascript event that Safari makes. When Safari triggers this event, my swf isn't completely loaded and my javascript can't see the ExternalInterface functions yet. So I want to initialize the JS functions once the swf is totally loaded by initializing my JS from an ExternalInterface.call from the swf's last frame - after all assets are loaded.

Any ideas on this? Has anyone tried this before? Is this the rule?
Thanks.

Jim
This topic has been closed for replies.

2 replies

xchanin
Participating Frequently
March 24, 2009
Can you create a javascript function on your page that loads the external .js file and then call the other function from your external interface?
March 24, 2009
I don't think external Javascript has to do any thing with your problem
The only thing you should take care is the javascript is loaded before you call a function from flash.