So i got EI working with swfobject just fine; turns out i had omitted addParam("allowScriptAccess", "always");
SWF-to-container calls now work wonderfully as such:

ExternalInterface.call("methodName");

However, i'm having a hell of a party getting container-to-swf calls up and running; i keep getting the methodName is not defined error in firefox.

Here's my JS:

Rayon.BlackBox = function(){
   document.write('<div id="MediaPlayer">Content here</div>');
mediaPlayer = new SWFObject("mediaplayer.swf", "mediaPlayerMovie", "100%", "100%", "8");
   mediaPlayer.addParam("allowScriptAccess", "always");
   mediaPlayer.addParam("scale", "exactfit");
   mediaPlayer.addParam("menu", "false");
   mediaPlayer.addParam("salign", "TL");
mediaPlayer.write("MediaPlayer"); }
Rayon.BlackBox.prototype = {
   getMovie:function(movieName){
       if (navigator.appName.indexOf("Microsoft") != -1) {
           return window[movieName]
       }else {
           return document.getElementById(movieName);
       }
   },
   pushToList:function(jsonString){
       alert("push to playlist: "+jsonString);
       var movie = this.getMovie("mediaPlayerMovie");
       movie.addToPlayList(jsonString);
       alert("push done");
   }
}
var BlackBox = Rayon.BlackBox;

instanced with:
obj = new BlackBox();

and method called through:

obj.pushToList("jsonstring");

in the swf:

ExternalInterface.addCallback("addToPlayList",null,addToPlayList);

I've tried alerting on the return value for getMovie and it does return a relevant value. However i keep getting "movie.addToPlayList is not a function" errors

Anyone know what i'm doing wrong?

- Andreas R
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to