Does AS3 show cacheasbitmap in preview?
Posted
by Fahim Akhter
on Stack Overflow
See other posts from Stack Overflow
or by Fahim Akhter
Published on 2010-05-25T09:13:03Z
Indexed on
2010/05/25
11:31 UTC
Read the original article
Hit count: 329
flash
|actionscript-3
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;
}
}
}
}
© Stack Overflow or respective owner