I swear I had this exact code working previously.
Now when I compile no errors are thrown... However onDeviceReady is never called. Is there something I am not seeing here ?
Any help is appreciated
// this is our main view
var view:StageWebViewBridge;
// init the disk filesystem
StageWebViewDisk.addEventListener(StageWebviewDiskEvent.END_DISK_PARSI NG, onInit );
StageWebViewDisk.setDebugMode( true );
StageWebViewDisk.initialize(stage);
// Fired when StageWebviewDiskEvent cache process finish
function onInit( e:StageWebviewDiskEvent ):void
{
trace("onInit CALLED");
// create the view
view = new StageWebViewBridge( 0,0, 320,240 );
// listen StageWebViewBridgeEvent.DEVICE_READY event to be sure the communication is ok
view.addEventListener(StageWebViewBridgeEvent.DEVICE_READY, onDeviceReady );
// add a callback method for the function we like to call from Javascript
view.addCallback('fnCalledFromJS', fnCalledFromJS );
// load the localfile demo.html ( inside the www dir )
//view.loadLocalURL('applink:/ExampleBasic.html');
view.loadURL("http://www.google.com");
// listen for onclick to call a javascript function from As3
///button.addEventListener(MouseEvent.CLICK, callJavascriptFunction );
}
function onDeviceReady( e:Event ):void
{
trace("I'm Ready");
// all is loaded and ok, show the view
addChild( view );
}
function fnCalledFromJS( data:String ):void
{
// append the text coming from JS to the textarea component
}
function callJavascriptFunction( e:Event ):void
{
// call javascript fnCalledFromAs3 function from As3
///view.call('fnCalledFromAs3',null,'This String comes from AS3');
}