Hello Alex,

I had the same problem a while back ago. You need to init all the display
elements you have from the start of the application. With a viewstack its 
creationPolicy="all"
property. Look in to the documentation for a similar property for
TabNavigator.

Hope it helps.

Sincerely,
Kate


AF> Hello,

AF> not sure if Flex questions are allowed here?

AF> Why can't I refer to the tabs.table.spriteHolder.addChild(sprite);
AF> below? If I remove the TabNavigator and all Canvases, then
AF> spriteHolder.addChild(sprite); will work just fine:

AF> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
AF>     creationComplete="onCreationComplete();">
AF>     <mx:Script>
AF>         <![CDATA[
AF>             private function onCreationComplete():void
AF>             {
AF>                 var sprite:Sprite = new Sprite();
AF>                 var g:Graphics = sprite.graphics;

AF>                 g.lineStyle(1, 0xFF0000);
AF>                 g.beginFill(0xFF0000);
AF>                 g.drawCircle(200, 200, 20);
AF>                 g.endFill();

AF>                 tabs.table.spriteHolder.addChild(sprite);
AF>             }
AF>         ]]>
AF>     </mx:Script>

AF>         <mx:TabNavigator id="tabs" width="100%" height="100%">
AF>                 <mx:Canvas label="Tab1" width="100%" height="100%">
AF>                 </mx:Canvas>
AF>                 <mx:Canvas label="Tab2" id="table" width="100%" 
height="100%">
AF>                 </mx:Canvas>
AF>                     <mx:UIComponent id="spriteHolder" width="100%" 
height="100%"/>
AF>         </mx:TabNavigator>
AF> </mx:Application>

AF> Regards
AF> Alex
AF> _______________________________________________
AF> Flashcoders mailing list
AF> Flashcoders@chattyfig.figleaf.com
AF> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to