[flexcoders] Re: Adding tabs dynamically
Actually this fixed the problem: boxingareas.validateSize() after a tab has been added. --- In flexcoders@yahoogroups.com, Sam Lai wrote: > > Looks ok - I assume lineid in the XML doc progresses sequentially. > > Maybe try manually using AS3 to add 6 tabs to the tabnavigator using > similar code and see if it still happens, just to rule out the XML > doc? > > 2009/4/2 markgoldin_2000 : > > From the inside of a new Tab: > > TabNavigatorObj.addChildAt(this, TabNavigatorObj.getChildren().length - 1); > > > > > > --- In flexcoders@yahoogroups.com, Sam Lai wrote: > >> > >> How are you adding the tabs to the tabnavigator? > >> > >> 2009/4/2 markgoldin_2000 : > >> > I am having a problem adding tabs to tabnavigator. While I am going in > >> > one order tabs are generated in a different then mine. Here is some code > >> > although it's simplified: > >> > // Scan thru scanning each zone and add as many as needed > >> > zoneNumber = resultXML.children().length(); > >> > currentZone = 0; > >> > createNextTab(resultXML); > >> > private function createNextTab(resultXML:XML):void > >> > { > >> > if (currentZone < zoneNumber) > >> > { > >> > node = resultXML.zoneconfiguration[currentZone]; > >> > var Tab:boxing = new boxing(); > >> > Tab.id = node.lineid.toString(); > >> > Tab.label = "Boxing Area " + > >> > Tab.id + " "; > >> > Tab.paramObj.lineid = node.lineid; > >> > > >> > Tab.attachJobInProgress(boxingareas); > >> > > >> > callLater(createNextTab, > >> > [resultXML]); > >> > currentZone++; > >> > } > >> > } > >> > resultXML looks very simple: nodes with lineid. > >> > > >> > Tab.paramObj.lineid drives IDs of tabs. > >> > While I am going from 1 to 6, Tabs have a random order: mostly 2, 1, > >> > > >> > Hope my problem is clear. > >> > > >> > Thanks > >> > > >> > > >> > > >> > > >> > > >> > -- > >> > Flexcoders Mailing List > >> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > >> > Alternative FAQ location: > >> > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > >> > Search Archives: > >> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > >> > Links > >> > > >> > > >> > > >> > > >> > > > > > > > > > > > > > > -- > > Flexcoders Mailing List > > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > Alternative FAQ location: > > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > > Search Archives: > > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links > > > > > > > > >
Re: [flexcoders] Re: Adding tabs dynamically
Looks ok - I assume lineid in the XML doc progresses sequentially. Maybe try manually using AS3 to add 6 tabs to the tabnavigator using similar code and see if it still happens, just to rule out the XML doc? 2009/4/2 markgoldin_2000 : > From the inside of a new Tab: > TabNavigatorObj.addChildAt(this, TabNavigatorObj.getChildren().length - 1); > > > --- In flexcoders@yahoogroups.com, Sam Lai wrote: >> >> How are you adding the tabs to the tabnavigator? >> >> 2009/4/2 markgoldin_2000 : >> > I am having a problem adding tabs to tabnavigator. While I am going in one >> > order tabs are generated in a different then mine. Here is some code >> > although it's simplified: >> > // Scan thru scanning each zone and add as many as needed >> > zoneNumber = resultXML.children().length(); >> > currentZone = 0; >> > createNextTab(resultXML); >> > private function createNextTab(resultXML:XML):void >> > { >> > if (currentZone < zoneNumber) >> > { >> > node = resultXML.zoneconfiguration[currentZone]; >> > var Tab:boxing = new boxing(); >> > Tab.id = node.lineid.toString(); >> > Tab.label = "Boxing Area " + Tab.id >> > + " "; >> > Tab.paramObj.lineid = node.lineid; >> > >> > Tab.attachJobInProgress(boxingareas); >> > >> > callLater(createNextTab, >> > [resultXML]); >> > currentZone++; >> > } >> > } >> > resultXML looks very simple: nodes with lineid. >> > >> > Tab.paramObj.lineid drives IDs of tabs. >> > While I am going from 1 to 6, Tabs have a random order: mostly 2, 1, >> > >> > Hope my problem is clear. >> > >> > Thanks >> > >> > >> > >> > >> > >> > -- >> > Flexcoders Mailing List >> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt >> > Alternative FAQ location: >> > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 >> > Search Archives: >> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links >> > >> > >> > >> > >> > > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links > > > >
[flexcoders] Re: Adding tabs dynamically
> TabNavigatorObj.addChildAt(this, TabNavigatorObj.getChildren().length - 1); Just a guessI think your problem is "TabNavigatorObj.getChildren().length" Its not what you think it is (do a trace on it). instead, try using TabNavigatorObj.addChild(this); --- In flexcoders@yahoogroups.com, "markgoldin_2000" wrote: > > From the inside of a new Tab: > TabNavigatorObj.addChildAt(this, TabNavigatorObj.getChildren().length - 1); > > > --- In flexcoders@yahoogroups.com, Sam Lai wrote: > > > > How are you adding the tabs to the tabnavigator? > > > > 2009/4/2 markgoldin_2000 : > > > I am having a problem adding tabs to tabnavigator. While I am going in > > > one order tabs are generated in a different then mine. Here is some code > > > although it's simplified: > > > // Scan thru scanning each zone and add as many as needed > > > zoneNumber = resultXML.children().length(); > > > currentZone = 0; > > > createNextTab(resultXML); > > > private function createNextTab(resultXML:XML):void > > > { > > > if (currentZone < zoneNumber) > > > { > > > node = resultXML.zoneconfiguration[currentZone]; > > > var Tab:boxing = new boxing(); > > > Tab.id = node.lineid.toString(); > > > Tab.label = "Boxing Area " + > > > Tab.id + " "; > > > Tab.paramObj.lineid = node.lineid; > > > > > > Tab.attachJobInProgress(boxingareas); > > > > > > callLater(createNextTab, > > > [resultXML]); > > > currentZone++; > > > } > > > } > > > resultXML looks very simple: nodes with lineid. > > > > > > Tab.paramObj.lineid drives IDs of tabs. > > > While I am going from 1 to 6, Tabs have a random order: mostly 2, 1, > > > > > > Hope my problem is clear. > > > > > > Thanks > > > > > > > > > > > > > > > > > > -- > > > Flexcoders Mailing List > > > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > > Alternative FAQ location: > > > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > > > Search Archives: > > > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > > > Links > > > > > > > > > > > > > > >
[flexcoders] Re: Adding tabs dynamically
>From the inside of a new Tab: TabNavigatorObj.addChildAt(this, TabNavigatorObj.getChildren().length - 1); --- In flexcoders@yahoogroups.com, Sam Lai wrote: > > How are you adding the tabs to the tabnavigator? > > 2009/4/2 markgoldin_2000 : > > I am having a problem adding tabs to tabnavigator. While I am going in one > > order tabs are generated in a different then mine. Here is some code > > although it's simplified: > > // Scan thru scanning each zone and add as many as needed > > zoneNumber = resultXML.children().length(); > > currentZone = 0; > > createNextTab(resultXML); > > private function createNextTab(resultXML:XML):void > > { > > if (currentZone < zoneNumber) > > { > > node = resultXML.zoneconfiguration[currentZone]; > > var Tab:boxing = new boxing(); > > Tab.id = node.lineid.toString(); > > Tab.label = "Boxing Area " + Tab.id > > + " "; > > Tab.paramObj.lineid = node.lineid; > > Tab.attachJobInProgress(boxingareas); > > > > callLater(createNextTab, > > [resultXML]); > > currentZone++; > > } > > } > > resultXML looks very simple: nodes with lineid. > > > > Tab.paramObj.lineid drives IDs of tabs. > > While I am going from 1 to 6, Tabs have a random order: mostly 2, 1, > > > > Hope my problem is clear. > > > > Thanks > > > > > > > > > > > > -- > > Flexcoders Mailing List > > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > Alternative FAQ location: > > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > > Search Archives: > > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links > > > > > > > > >