Deu um tempo aqui e tentei reproduzir o porblema mas não consegui (o código que
envio abaixo funciona).
Estou tentando chegar na causa do teu problema, que eu não sei qual é...
Por acaso a tua estrutra é parecida com essa?
Application:
<mx:Script>
<![CDATA[
import mx.containers.Panel;
private var apanel:Panel=new Panel;
]]>
</mx:Script>
<ns1:MyVBox width="100%" height="100%" id="mybox"/>
<mx:Button label="insere" click="{mybox.panelDetail=apanel}"/>
MyVbox:
<mx:VBox
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.containers.Panel;
private var _mypanel:Panel;
public function set panelDetail(value:Panel):void{
_mypanel=value;
addChild(_mypanel);
_mypanel.title="III";
}
]]>
</mx:Script>
<mx:HBox backgroundColor="#8080C0" width="100%">
<mx:Label id="entryTitle" fontWeight="bold" fontSize="16"
text="OIOIOI"/>
<mx:Spacer width="100%" />
<mx:Button label="V" />
<mx:Button label="F" />
<mx:Button label="C" />
</mx:HBox>
</mx:VBox>
Gabriela Trindade Perry - http://www.gabriela.trindade.nom.br
Date: Tue, 25 Nov 2008 13:30:37 -0300
From: [EMAIL PROTECTED]
To: [email protected]
Subject: [flexdev] Re: Lista de DisplayObjects Dinamicos
Coloquei os breakpoints
Ele, em moemnto algum, para no this.addChildAt(_detail, getChildren().length);
André Coelho Brait da Silva
TeCGraf
Tel: (21) 3527-2502
Cel: (21) 8836-7622
2008/11/25 gabriela perry <[EMAIL PROTECTED]>
não...
override protected function createChildren():void{
super.createChildren();
/*
if(_detail != null) //pois aqui acho que ele não é null
mesmo... tens que ver se ele está na display list, entende???
{
*/
if(!getChildAt(getChildIndex(_detail)))
{
this.addChildAt(_detail, getChildren().length);
//coloca um breakpoint aqui
}
//}
}
public function set mapLegendEntryDetail(detail:MapLegendEntryDetail):void
{
_detail = detail;
//this.addChildAt(_detail, getChildren().length);
invalidateDisplayList();
//coloca um breakpoint aqui
}
Gabriela Trindade Perry - http://www.gabriela.trindade.nom.br
Date: Tue, 25 Nov 2008 13:12:48 -0300
From: [EMAIL PROTECTED]
To: [email protected]
Subject: [flexdev] Re: Lista de DisplayObjects Dinamicos
Bom, eu não sei se fiz certo o q vc recomendou, mas fiz isso:
override protected function createChildren():void{
super.createChildren();
if(_detail != null)
{
if(!getChildAt(getChildIndex(_detail)))
{
this.addChildAt(_detail, getChildren().length);
}
}
}
public function set mapLegendEntryDetail(detail:MapLegendEntryDetail):void
{
_detail = detail;
this.addChildAt(_detail, getChildren().length);
invalidateDisplayList();
}
foi isso que vc falou pra eu fzr? Se foi, não funcionou
André Coelho Brait da Silva
TeCGraf
Tel: (21) 3527-2502
Cel: (21) 8836-7622
2008/11/25 gabriela perry <[EMAIL PROTECTED]>
haha, não é addChildren, é createChildren :0P
Gabriela Trindade Perry - http://www.gabriela.trindade.nom.br
From: [EMAIL PROTECTED]
To: [email protected]
Subject: [flexdev] Re: Lista de DisplayObjects Dinamicos
Date: Tue, 25 Nov 2008 15:45:22 +0000
Acho que entendo...
Cara, antes de mais nada: não estou com o Flex aberto aqui...
Então, tenta assim: no setter, chama invalidateDisplayList() //é isso mesmo???
Sobrescreve o método addChildren (deve ser mais ou menos assim):
override protected function addChildren():void{
super.addChildren();
if(!getChild(detail)) // cara, tens que ver algum método aqui pra ver se o
_detail foi adicionado{
this.addChildAt(_detail, getChildren().length);
}
}
Veja se isso ajuda...
Tem coisas sobre esse método na documentação,
Gabriela Trindade Perry - http://www.gabriela.trindade.nom.br
Date: Tue, 25 Nov 2008 11:19:49 -0300
From: [EMAIL PROTECTED]
To: [email protected]
Subject: [flexdev] Lista de DisplayObjects Dinamicos
Boa tarde galera.
Estou criando uma lista de display objects. Isso é fácil, setando o renderer da
lista e tudo mais, mas acabei batendo num problema.
A meu item da Lista (MapLegendEntry) é montado dinamicamente. Fora o header
delse que é fixo, eu adiciono mais um painel nele dinamicamente.
O problema é que a lista só está mostrando o componente "cru". Não está
mostrando como ele seria depois de eu adicionar o outro componente
dinamicamente.
Não sei se deu pra entender o que eu expliquei.
Aqui está o código do MapLegendEntry:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
borderStyle="solid" borderThickness="2" xmlns:MapLegend="MapLegend.*"
xmlns:MapLegendDetails="View.Components.MapLegend.MapLegendDetails.*"
xmlns:MapLegend1="View.Components.MapLegend.*" creationComplete="init();"
paddingLeft="0">
<mx:Script>
<![CDATA[
private var _detail:MapLegendEntryDetail;
private var _title:String;
public function init():void
{
//this.addChildAt(_detail, getChildren().length);
}
public function set
mapLegendEntryDetail(detail:MapLegendEntryDetail):void
{
_detail = detail;
this.addChildAt(_detail, getChildren().length);
}
public function set title(title:String):void
{
_title = title;
}
]]>
</mx:Script>
<mx:HBox backgroundColor="#8080C0" width="100%">
<mx:Label id="entryTitle" fontWeight="bold" fontSize="16"
text="{_title}"/>
<mx:Spacer width="100%" />
<mx:Button label="V" />
<mx:Button label="F" />
<mx:Button label="C" />
</mx:HBox>
</mx:VBox>
Apesar de eu adicionar o MapLegendEntryDetail antes de adicionar o Maplegend na
lsita, ela não mostra o componente.
Alguam idéia?
André Coelho Brait da Silva
TeCGraf
Tel: (21) 3527-2502
Cel: (21) 8836-7622
Get news, entertainment and everything you care about at Live.com. Check it out!
Discover the new Windows Vista Learn more!
Get news, entertainment and everything you care about at Live.com. Check it out!
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
--~--~---------~--~----~------------~-------~--~----~
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para [email protected]
Para sair da lista, envie um email em branco para [EMAIL PROTECTED]
Mais opções estão disponíveis em http://groups.google.com/group/flexdev
-~----------~----~----~----~------~----~------~--~---