StageWebViewBridge is an extended version of flash.media.StageWebView, which is a class to display HTML content in a stage view port. It provides simple means to display HTML content on devices where the HTMLLoader class is not supported.
Some features of StageWebViewBridge:
- Extends Bitmap class, you can modify his x,y,alpha,rotation,visible, etc ( Version 1 Beta )
- Communicates Actionscript with Javascript.
- Communicates Javascript with Actionscript.
- Load local files and resources in a easy way.
- Extends loadString method with AS3 – JS communication.
- Extends loadString method to load local resources.
- Lets you take an SnapShot to use as the bitmapData of the bitmap.
Sample
// create StageWebViewBridge instance // new StageWebViewBridge( x,y,width,height ) var view:StageWebViewBridge = new StageWebViewBridge( 0, 150, 320, 280 ); // add listener for when page becomes loaded view.addEventListener( Event.COMPLETE, onViewLoadComplete ); // enable javascript to call function helloWorldFromJS view.addCallback('helloWorldFromJS', helloWorldFromJS ); // load content to the view view.loadLocalURL('appfile:/index.html'); // as StageWebViewBridge extends Bitmap // we can now add it to the displaylist addChild( view ); // event listener that gets called on page load complete function onViewLoadComplete( e:Event ):void { trace('view loaded'); // call a javascript function after the page loads // that will do an alert with the date passed from as3 view.call('helloWorldFromAS3', null, new Date().toString() ); } // function to be called from JS function helloWorldFromJS( at:String ):void { trace('helloWorldFromJS called from JavaScript at '+ at ); }
New: StageWebViewBridge (extended version of flash.media.StageWebView) http://t.co/mzYPrBuR #as3 #flash #gamedev
“@as3gamegears: New: StageWebViewBridge (extended version of flash.media.StageWebView) http://t.co/xHlOweD6 #as3 #flash #gamedevâ€
New: StageWebViewBridge (extended version of flash.media.StageWebView) http://t.co/z9nEvy8g #as3 #flash #gamedev (via @as3gamegears)
RT @nanuken: New: StageWebViewBridge (extended version of flash.media.StageWebView) http://t.co/KG96BMle #as3 #f… http://t.co/GhmN4Adm