PDA

View Full Version : ExternalInterface.call problem



adnan794
February 17th, 2009, 07:43 AM
Hi

I have a swf file in which when a button is clicked it calls a function in a javascript file using ExternalInterface.call

Now everything works fine if all files are in one folder.

but now If a place the swf file in this location /assets/swf/test.swf and the java script file in this location /assets/scripts/test.js

it doesnt work can someone suggest a solution to this please?

Thanks

Scott64
February 17th, 2009, 08:54 AM
The way I've always understood the ExternalInterface, is that anything you want to call must be accessible to the HTML file the swf is embedded in. Could be as simple as your html file saying
<script src="test.js" language="javascript"></script>
when it needs to say
<script src="../scripts/test.js" language="javascript"></script>
(assuming you're embedding the swf into HTML and the HTML is stored in the same directory as the swf or in another directory on the same level as your swf directory).