Has anyone been successful in using StageWebViewBridge to load and communicate with an online web page?
http://code.google.com/p/stagewebviewbridge/wiki/Communication
The documentation and examples offered are all configured around working with local files (which work successfully) and although the instruction to ‘include the StageWebViewBridge.js’ file within the loaded html page sounds very straight forward, sadly it doesn’t seem to work.
For anyone wanting to replicate my test I have uploaded the files here:
http://www.infin8design.com/clients/stack/swvb.zip
I’m basically loading the ‘ExampleCallBackFuncions.html’ file from a web server.
I’ve included the StageWebViewBridge.js file like so…
<script type="text/javascript" src="StageWebViewBridge.js"></script>
When I test the movie I get the correct setup output messages
_serializeObject =>___onDomReady
_serializeObject =>___getFilePaths
_serializeObject =>___onDeviceReady
_serializeObject =>fnCalledFromJS
and the html page appears in the viewport. But on pressing the button which should send a message to Actionscript I get the following error messages:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at es.xperiments.media::StageWebViewBridgeExternal/parseCallBack()[/Users/G5TowerIntel/Desktop/maptest/es/xperiments/media/StageWebViewBridgeExternal.as:88]
at es.xperiments.media::StageWebViewBridge/onLocationChange()[/Users/G5TowerIntel/Desktop/maptest/es/xperiments/media/StageWebViewBridge.as:236]
My goal is to send a message back to ActionScript from the html page.
Thanks,
Mark
You are doing some things wrong in your code….
You must listen to DEVICER_READY event before do any comm between as3 and js and viceversa…
You can take my ExampleBasic and change the line with:
view.loadLocalURL(‘applink:/ExampleBasic.html’);
to
view.loadURL(‘http://localhost/ExampleBasic.html’);
Then in the server html file add the line with reference to the .js file
It must work…
Say me…