actionscript 3 - How to make an object disappear in Action Script 3 -


i have used following code show html page in app supported action script 3.0 , adobe air.

imports import flash.events.event; import flash.events.locationchangeevent; import flash.geom.rectangle; import flash.media.stagewebview; import flash.net.navigatetourl; import flash.net.urlrequest; import flash.events.mouseevent;  //setup variables var _stagewebview:stagewebview; var myadverturl:string = "http://letschant.890m.com/v25.html";  // check _stagewebview doesn't exist if (!_stagewebview) {     _stagewebview = new stagewebview() ;     // set size of html 'window'     _stagewebview.viewport = new rectangle(0, 0, 480, 688);     // add listener when content of stagewebview changes     _stagewebview.loadurl(myadverturl); } // show ad setting it's stage property; _stagewebview.stage = stage; 

so, if click button these should disappear. know should use visible:false, should put code?, aint movie clip, how should this?

please help. thank :d

stagewebview not displayobject. cannot set visible property. you'll have use api call hide web view. setting viewport rectangle of 0 pixels width , height job.

addressing immediate problem, place button on stage , give instance name btntoggle. add following code in same frame you've added current chunk.

this.btntoggle.addeventlistener(mouseevent.click, function(event:mouseevent):void {     _stagewebview.viewport = new rectangle(0, 0, 0, 0); }); 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -