Does AS3 show cacheasbitmap in preview?
- by Fahim Akhter
The following code shows me that cacheasbitmap is turning on and off like it is suppose to but, I never get to see it visually like I did in AS2. Is this a error or a change in actionscript?
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
public class Bitmapascache extends Sprite
{
private var isOn:Boolean=false;
private var box:mainBox;
public function Bitmapascache()
{
box = new mainBox()
box.addEventListener(MouseEvent.MOUSE_DOWN,click);
this.addChild(box);
}
public function click(e:MouseEvent):void
{
trace("click :"+box.cacheAsBitmap);
if(isOn){
box.cacheAsBitmap = false;
isOn = false;
}
else{
box.cacheAsBitmap = true;
isOn = true;
}
}
}
}