I am porting a working xulrunner application from Windows to Mac OS X
Tiger . The xpcom part compiles and works fine , but i have a XUL page
which contains an embedded flash preloader. This is just a flash movie
called "preloader.swf" which exports a method to Javascript , called
'loadMovie' . 'loadMovie' takes one argument path_to_Movie , which is
the full path to another flash movie . Invoking this method results in
loading the movie specified by path_to_Movie into the flash player.
The flash movie is embedded like this.
<html:embed id="flashapp" name="flashapp"
src="preloader.swf"
quality="high"
bgcolor="#ffffff" width="300" height="300"
align="middle"
allowScriptAccess="always"
type="application/x-shockwave-flash"
swLiveConnect="true"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
There is also a button in the XUL page ..
<hbox id = "testpanel" hidden = "false" align = "right">
<button label = "Load" onclick = "LoadMovie('keyboard.swf");" hidden =
"false" id = "btnLoad"/> </hbox>
And the script that actually calls the flash object's method
<script>
function LoadMovie(path_to_movie)
{
alert('inside LoadMovie()');
try
{
//This is how the flash object's method is invoked.
document.getElementById("flashapp").loadMovies(path_to_movie);
}
catch(e)
{
alert(e);
}
}
</script>
Loading this XUL page in Firefox 2.0 / Camino works fine. The movie is
loaded and all. But when i use xulrunner to run this as a standalone
application , it gives me an error which says "Error calling method on
NPObject! [plugin exception: Error in Actionscript. Use a try/catch
block to find error.]"
I am using xulrunner 1.8.1.3 for Mac. I have also set the required
security permissions for Flash via Flash Player TrustFiles placed
inside /Users/aUname/Library/Preferences/Macromedia/Flash Player/
#Security/
Another interesting thing is that a flash movie can communicate with
Javascript perfectly. No issues there . Its the JS to Flash , that too
on xulrunner , is getting me stuck
Thanks in advance
Try placing the flashplayer plugin ( Copy from Internet Plugins folder
in Mac ) in the applicatioins plugin folder and then try to launch the
aplication.