[Flashjs] Success - but unable to get AS to get back return values after a call to JS fxn

Sandeep Jangity sjangity at gmail.com
Sat Mar 24 18:06:41 EST 2007


Following along this flashjs tutorial:
http://osflash.org/projects/flashjs/tutorials/simreturn

I can call JS from AS, but not vice-versa. Please help. This is for a major
project and I need this working. As from the example given:
flashProxy.call("setXMLSource") is NEVER TALKING to my testOpen.sfw file.
The "setXMLSource" method basically makes another proxy.call to my HTML page
and calls the "checkReturnType" javascript function. But that doesn't work.
That function is never called, so I figure the proxy setup isn't right. I
know you are using LocalConnection, but I am doing this on the server-side,
so what do I need to change?

Also, I wasn't sure if we actually need a 'myFlashStuff.SFW' file. I am
basically trying to call a AS function defined in testOpen.sfw.

HTML:
<!-- this script is what creates a new flash timeline -->
<script>
    //create unique id
    var lcId = new Date().getTime();

    //create proxy to flash
    var flashProxy = new FlashProxy(lcId, 'myFlashStuff',
"/javascript/JavaScriptFlashGateway.swf");

    // called from my PRIVATE.FLA
    function getTimeLineXMLSRC() {
        alert('flash to javascript');
        flashProxy.call("setXMLSource");
    }

    function checkReturnType() {
        alert('checking return type');
    }
</script>

<script>
   var sample = new FlashTag("testOpen.sfw", 1100, 130);
   sample.setFlashvars("lcId=" + lcId);
   sample.setId('myFlashStuff');
   sample.setFlashvars("flashSource=
https://www.measuremap.com/developer/slider/&contentLicense=http://creativecommons.org/licenses/by/2.0/");

   sample.write(document);
</script>

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/flashjs_osflash.org/attachments/20070324/2fde936d/attachment.htm


More information about the Flashjs mailing list