thuansaritasa / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

Flash as3 ExternalInterface won't recieve JavaScript calls using swfobject 2.1 (error: unknown function) #291

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use the current version (2.1) of swfobject to load a swf into the site,
which uses ExternalInterface.addCallback to recieve commands from JavaScript.

2. try to call the as3 function

code like:
function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
    } else {
        return document[movieName];
    }
}

var swf = thisMovie('flashMovieId');
swf.theFlashFunction();

3.

What is the expected output? What do you see instead?
I would expect flash to run the function. Instead FireBug Console says that
swf.theFlashFunction() is a unknown function.

What version of the product are you using? On what operating system?
swfobject 2.1 on Firefox 3.0.8 on MacOS 10.5.6 und Safari 4 beta on MacOS
10.5.6.

Please provide any additional information below.

with swfobject 1.5 everything is okay.

Original issue reported on code.google.com by christia...@gmail.com on 1 Apr 2009 at 1:05

GoogleCodeExporter commented 9 years ago
It works fine, please study the example pages from the wiki.

Original comment by bobbyvandersluis on 1 Apr 2009 at 2:56