Hi,
I have been trying to communicate between JS and Flash using the JS/Flash integration kit from osflash.org. Communication from AS to JS works fine, I am having problems with JS to AS communication though: anytime I try to access an AS function from JS, none of my parameters I try to pass to the AS-function are actually recognized. Is there a trick to this? Maybe it is a scope problem? I am not sure, but I cannot see a reason why this is not working.

Here is a very reduced version of my AS-Code:

----> Class FlvPlayer
import mx.video.FLVPlayback;
import mx.utils.*;
import com.macromedia.javascript.JavaScriptProxy;

class FlvPlayer{
  var jsProxy:JavaScriptProxy;
    //Constructor Method
  function FlvPlayer(flvPlaybackInstance:FLVPlayback) {
      jsProxy = new JavaScriptProxy(_root.lcId, this);        }
//is called from JS and is supposed to load the new file, but does not receive any arguments --> all the vars are "undefined"
  function loadNewFiles(item){
_root.debug(item + ' / vFile: '+ item.videoFile +"/ cpFile:"+ item.cuePointsFile); }
        //called when a cuePoint is reached --> as2js com works fine
function cuePointReached(evtObj:Object){ //call a js funciton in page, that displays the tiel and description jsProxy.call("displayDescription", cuePointData[currentCuePoint].title, cuePointData[currentCuePoint].description); currentCuePoint++;
  }
}

--> the call inside my JS-File:
var dataObj = {movieUrl:'test', cuePointFileUrl:cuePointFileUrl}; flashProxy.call('loadNewFiles', dataObj);

the function is called correctly but none of the parameters are passed, dataObj is 'undefined' when I trace it.
Any help is greatly appreciated.

Cheers,
Andreas Stephan
_______________________________________________
[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