开发者

Does AS3 show cacheasbitmap in preview?

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.addEventListen开发者_如何学Cer(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;
        }
    }
}

}


taken from Livedocs:

After you set the cacheAsBitmap property to true, the rendering does not change, however the display object performs pixel snapping automatically. The animation speed can be significantly faster depending on the complexity of the vector content.

there is no visual change as such, even in as2 as far as i recall.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜