Actually, a TabBar holds Tabs which are buttons. Do you want to create TabNavigators instead? They hold Canvases.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Sheriff Sent: Tuesday, October 16, 2007 12:45 PM To: [email protected] Subject: Re: [flexcoders] Can't figure out why this fails : creating a TabBar using AS the tabBar holds buttons, tab itself is a button so we are u using a canvas? ----- Original Message ---- From: oneproofdk <[EMAIL PROTECTED]> To: [email protected] Sent: Tuesday, October 16, 2007 2:39:43 PM Subject: [flexcoders] Can't figure out why this fails : creating a TabBar using AS Hi. I'm trying to loop through a ArrayCollection and make a TabBar for each item This fails miserably - "Cant convert Canvas to Button" - I've been staring at this all day today (it's almost 10pm here in Denmark now). So I'd be very please if some of you guys could have a look - propably some stupid mistake or misunderstanding. But it just dont work... for (var i:int=0; i<dp.length; i++) { // First we make a new tabbar for the tiles var newTB:TabBar = new TabBar(); newTB.id = 'tabbar'+ dp[i].id; newTB.percentWidth = 100; // Then we make a canvas to hold the items var newCV:Canvas = new Canvas(); newCV.id = 'canvas'+ dp[i].id; newCV.percentWidth = 100; newCV.label = dp[i].orgname; // Then we make a new TileList var newTL:TileList = new TileList(); newTL.id = 'tilelist'+ dp[i]; newTL.percentWidth = 100; newTL.itemRenderer = projectTile as IFactory; newTL.dataProvider = dp; newCV.addChild( newTL ); newTB.addChild( newCV ); pageOverviewVBox. addChild( newTB ); // This is a VBox. } Also... when this finally works for me - how can I set what itemrenderer the tilelist should use ?? Also failed :-| Thanks for your time Mark ________________________________ Be a better Globetrotter. Get better travel answers <http://us.rd.yahoo.com/evt=48254/*http:/answers.yahoo.com/dir/_ylc=X3oD MTI5MGx2aThyBF9TAzIxMTU1MDAzNTIEX3MDMzk2NTQ1MTAzBHNlYwNCQUJwaWxsYXJfTklf MzYwBHNsawNQcm9kdWN0X3F1ZXN0aW9uX3BhZ2U-?link=list&sid=396545469> from someone who knows. Yahoo! Answers - Check it out.

