I have some code that when I use a Sprite the width and height values ares set when using addChild but when using a SpriteVisualElement the width and height are 0.
var sprite:Sprite = new Sprite();
// ...
sprite.cacheAsBitmap = true;
sprite.transform.matrix = target.transform.matrix;
sprite.addChild(bitmap); // width and height 250x65
var spritevisualElement:SpriteVisualElement = new SpriteVisualElement();
// ...
spriteVisualElement.cacheAsBitmap = true;
spriteVisualElement.transform.matrix = target.transform.matrix;
spriteVisualElement.addChild(bitmap); // spriteVisualElement width and height 0x0
What is going on? Can I make SpriteVisualElement work?