I want to add a simple spinnerloader(movieclip) over a StageWebView html page for that i converted StageWebView page to bitmap but that didnt work please help me to solve this problem
var webView:StageWebView = new StageWebView();
var textGoogle:TextField=new TextField();
var textFacebook:TextField=new TextField()
textGoogle.htmlText="<b>Google</b>";
textGoogle.x=300;
textGoogle.y=-80;
addChild(textGoogle);
textFacebook.htmlText="<b>Facebook</b>";
textFacebook.x=0;
textFacebook.y=-80;
addChild(textFacebook);
textGoogles.addEventListener(MouseEvent.CLICK,goGoogle);
textFacebooks.addEventListener(MouseEvent.CLICK,goFaceBook);
webView.stage = this.stage;
webView.viewPort = new Rectangle(0, 100, stage.stageWidth, stage.stageHeight);
function goGoogle(e:Event):void
{
webView.loadURL("http://www.google.com");
webView.stage = null;
webView.addEventListener(Event.COMPLETE,handleLoad);
}
function goFaceBook(e:Event):void
{
webView.loadURL("http://www.facebook.com");
webView.stage = null;
webView.addEventListener(Event.COMPLETE,handleLoad);
}
function handleLoad(e:Event):void
{
var bitmapData:BitmapData = new BitmapData(webView.viewPort.width, webView.viewPort.height,true,0xffffff);
webView.drawViewPortToBitmapData(bitmapData);
var webViewBitmap:Bitmap=new Bitmap(bitmapData);
webViewBitmap.y = 100;
addChild(webViewBitmap);
}
This should be possible. Once you have created your bitmap: 1. remove the StageWebView from the stage 2. add your bitmap to the stage. 3. add your movie clip to the stage.