Flex : SpriteVisualElement can not add as a child Spark Label? -


            var s : spritevisualelement = new spritevisualelement();                 s.graphics.beginfill( 0xffff00 );                 s.graphics.drawrect( 0, 0, 100, 20 );                 s.graphics.endfill();                 s.width = 100;                 s.height = 20;             this.addelement( s ) ;              var l : label = new label();                 l.text = "text";                 l.width = s.width;                 l.height = s.height;             s.addchild( l ); 

the follow code seems not working ( flex 4.5 ).

  • what cause issue, , how fix ?

it's not being displayed because you're not adding label (which uicomponent , works component lifecycle) uicomponent instantiate properly. spritevisualelement not made have uicomponents within it, it's made have sprites can draw itself. label waiting 'invalidatedisplaylist' called can draw itself.

either force draw or use uicomponent container label.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -