I'm using StageWebView to load SWF files or HTML pages with SWF content on my Adobe Air 3.8 app for Android and I have a problem when I set the X offset in the viewport. The SWF gets cut off on the right side.
See this screenshot:
Image may be NSFW.
Clik here to view.
The viewport covers the area enclosed in the rectangle with a grey border but a portion of the rhino gets cut off. If I set the X offset to 0, the webview instance shows the SWF properly but the higher the X offset the wider the portion that gets cut off.
I need to add this happens only on Android running ICS (4.0.4). On devices running Jelly Bean, such problem does not happen.
One more thing: the black "patch" that covers the rhino part is the background color of the swf. I tested this problem with different SWFs and the strip that shows up on the right side is always of the same color as the remote SWF's background.
I need to show SWF content centered on the stage and this offset bug is a killer.
Does anybody know of a fix for a problem like this?
My code:
function loadFlashWebView():void {
//load Flash webview for testing plugin
webView = new StageWebView();
webView.stage = this.stage;
webView.loadURL(flashTestURL);
webView.addEventListener(Event.COMPLETE, onLoadFlashViewComplete);
}
function onLoadFlashViewComplete(evt:Event):void {
//load view complete handler
trace("Web view finished loading. Error: " + webview_error);
webView.viewPort = new Rectangle(67, 80, stage.stageWidth, stage.stageHeight); //the swf gets cut off in ICS
}
var flashTestURL:String = "http://mywebsite.com";
var webView:StageWebView;