Skip to content Skip to sidebar Skip to footer

Externalinterface

Hey, so I'm having a bunch of trouble getting ExternalInterface to work, which is odd, because I use it somewhat often. I'm hoping it's something I just missed because I've been lo

Solution 1:

The Flash isn't actually finished constructing yet. You're calling your flash_ready callback from the constructor, and so the JS is trying to call in before the object is on the stage. Move your flash_ready call to, say, an Event.ADDED_TO_STAGE listener and it should start working.

Solution 2:

Ok, so after further investigation, it appears that there was a problem with multiple instances of the flash object, because I was cloning it to a lightbox. I have gotten it working now.

Solution 3:

Just spent 5 hours fighting with this. It was all really frustrating. In my case the solution was very very simple and I would have never guessed it. So first of for all of you who have never seen the flash player debugger running on files inside your browser finding this link that walks you through the setup has resulted in a somewhat magical experience :) Now to my ExternalInterface discovery: There was a sandbox violation inside the same domain. This meant that flash cannot access www.yourdomain.com from yourdomain.com. The weird thing of course is that you are not explicitly calling the domain with ExternalInterface. Anyhow, the solution was very simple: add this to my .htaccess file and that was it!

# Redirect non-www to www 
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) http://www.youtdomain.com/$1 [R=301,L] 

Hope this helps someone

Solution 4:

Is flash_ready receiving the objectID that you are expecting?

Also, why use:

var jscommand:String = "flash_ready('"+ExternalInterface.objectID+"');";
var url:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);");
navigateToURL(url, "_self");

When this is designed to do that:

ExternalInterface.call("flash_ready", ExternalInterface.objectID);

Solution 5:

Post your source (pre-generatred). When your browser says [Flash].Method is not a function, 99% of the time it means that you tried calling a function in Flash before the .swf was ready for it. I see that you tried to do that, but clearly its not working so something must be off. So post your pre-rendered source and I am sure we can find the problem.

Post a Comment for "Externalinterface"