Hi,
I have been trying to communicate between JavaScript and Flash using the 
JavaScript/Flash integration kit from osflash.org.
Communication from ActionScript to JavaScript works fine, but I am having
problems with JavaScript to ActionScript communication: anytime I call an AS
function from JS, the function is called (so I assume set up my HTML/JS
correctly), but none of my passed parameters are recognized. Maybe it is a
scope problem? Has anyone ever managed to get this working inside an
AS-Class?

Cheers,
Andy

Here is a very reduced version of the Code:

----- 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() {
jsProxy = new JavaScriptProxy(_root.lcId, this);
}


/*is called from JS, but does not receive any arguments --> item is
"undefined"*/
function loadNewFiles(item){
trace('object: '+item + "/ cpFile:"+ item.cuePointsFile);
}
}

------------- JS-CODE inside page -----------------------

var dataObj = {movieUrl:'test', cuePointFileUrl:'dummy.xml'};          
flashProxy.call('loadNewFiles', dataObj);

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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