Boas,

De facto o teu exemplo funciona...mas não é exactamente o meu
problema, mas é quase.

No teu exemplo tu tens uma aplicação com um componente e fazes a
ligação entre a aplicação e um componente exterior. Isto é ligas a
lista ao painel exterior.
No meu caso eu tenho 3 ficheiros, um com a aplicação geral e 2
ficheiros de componentes que estão dentro da aplicação principal. Eu
quero fazer a ligação entre esse dois componentes. Espero que me faça
entender.

Sendo mais claro tenho:


Aplicação principal (Home)....que tem embutidos:
-menuNoticias
-mainRight

O que quero fazer é ao seleccionar uma noticia no menuNoticias e eu
possa visualizar o seu conteúdo, através da alteração do State no
mainRight.
Segue a baixo o codigo para que me faça entender melhor:

Aplicação principal
##########################################################################

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; width="990"
height="550" xmlns:ns1="componentes.*">

<ns1:CalendarioEventos bottom="10" left="10">
        </ns1:CalendarioEventos>

<ns1:menuNoticias left="10" verticalCenter="-72" id="menuNoticias">
        </ns1:menuNoticias>

<ns1:bannerTopLeft left="10" top="10">
        </ns1:bannerTopLeft>

<ns1:mainRight x="248" y="10" id="mainRight">
        </ns1:mainRight>
</mx:Application>


Componente menuNoticias
####################################################################################33

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="230"
height="290"
        borderStyle="solid"
        borderColor="#000000"
        cornerRadius="12"
        backgroundColor="#000000"
        creationComplete="utilizadoresService.getUtilizadores()">

        <mx:Script>
                <![CDATA[
                        import mx.collections.ArrayCollection;
                        import mx.rpc.events.ResultEvent;

                [Bindable]
                private var dp:ArrayCollection;

                private function getUtilizadoresHandler(event:ResultEvent):void
                        {
                                dp=event.result as ArrayCollection;
                        }
            ]]>
        </mx:Script>

        <mx:RemoteObject id="utilizadoresService"
                destination="utilizadoresDestination"
                source="GestorDeUtilizadoresService"
                showBusyCursor="true">

          <mx:method name="getUtilizadores"
result="getUtilizadoresHandler(event)"/>

        </mx:RemoteObject>

        <mx:Accordion width="206" height="266" horizontalCenter="1"
verticalCenter="-1" fontFamily="Verdana">
                <mx:Canvas label="Últimas Notícias" width="211" height="228"
                        backgroundAlpha="1.0"
                        alpha="1.0"
                        backgroundColor="#000000" id="painelNoticias">

                        <mx:List width="100%"
                                dataProvider="{dp}"
                                color="#ffffff"
                                labelField="nome"
                                backgroundColor="#000000"
                                borderStyle="none"
                                rowHeight="30" horizontalCenter="0" 
height="100%"
verticalCenter="-3" itemClick="mainRight.currentState='noticias'">
                        </mx:List>

                </mx:Canvas>

                <mx:Canvas label="Eventos" width="211" height="228"
                        backgroundAlpha="0.0"
                        color="#ffffff">

                        <mx:List width="100%"
                                alpha="1.0"
                                backgroundAlpha="1.0"
                                backgroundColor="#000000"
                                borderStyle="none" horizontalCenter="0" 
height="100%"
verticalCenter="0">
                        </mx:List>

                </mx:Canvas>

        </mx:Accordion>

</mx:Canvas>


Componente
mainRight############################################################################################

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="732"
height="530"
        borderStyle="solid"
        borderColor="#000000"
        cornerRadius="12"
        backgroundColor="#000000">
        <mx:states>
                <mx:State name="eventos">
                        <mx:RemoveChild target="{image2MainRight}"/>
                        <mx:AddChild position="lastChild">
                                <mx:TitleWindow id="janelaEventos2" x="10" 
y="209" width="710"
height="280" layout="absolute" title="Eventos">
                                        <mx:HBox x="0" y="10" width="680" 
height="230" id="tituloNoticia"
horizontalAlign="center" verticalAlign="middle">
                                                <mx:VBox height="100%" 
width="478" color="#ffffff" fontSize="25"
fontFamily="myFont" horizontalAlign="center" verticalAlign="middle">
                                                        <mx:Text text="Título 
do Evento" color="#ffffff" width="439"
height="32"/>
                                                        <mx:TextArea 
width="436" height="180" alpha="1.0"
backgroundAlpha="0.0" color="#ffffff" cornerRadius="12"
borderColor="#006600"/>
                                                </mx:VBox>
                                                <mx:Image width="182" 
height="219" scaleContent="true"/>
                                        </mx:HBox>
                                </mx:TitleWindow>
                        </mx:AddChild>
                        <mx:SetProperty target="{label1}" name="text" 
value="Pesquisar
Notícia"/>
                </mx:State>
                <mx:State name="noticias">
                        <mx:RemoveChild target="{image2MainRight}"/>
                        <mx:AddChild position="lastChild">
                                <mx:TitleWindow id="janelaNoticias" x="10" 
y="209" width="710"
height="280" layout="absolute" title="Notícias">
                                        <mx:HBox x="0" y="10" width="680" 
height="230"
id="tituloNoticia2" horizontalAlign="center" verticalAlign="middle">
                                                <mx:VBox height="100%" 
width="478" color="#ffffff" fontSize="25"
fontFamily="myFont" horizontalAlign="center" verticalAlign="middle">
                                                        <mx:TextArea 
width="436" height="212" alpha="1.0"
backgroundAlpha="0.0" color="#ffffff" cornerRadius="12"
borderColor="#006600"/>
                                                </mx:VBox>
                                                <mx:Image width="182" 
height="219" scaleContent="true"/>
                                        </mx:HBox>
                                </mx:TitleWindow>
                        </mx:AddChild>
                        <mx:SetProperty target="{label1}" name="text" 
value="Pesquisar
Evento"/>
                </mx:State>
        </mx:states>

        <mx:WipeDown id="wipeD" duration="1500"/>
    <mx:WipeUp id="wipeU" duration="1500"/>

        <mx:Image width="710" id="imagemTop"
                autoLoad="true"
                source="@Embed('imagensComponentes/CanvasCima.jpg')"
                scaleContent="false"
                creationCompleteEffect="{wipeD}"
                right="10" top="10" height="191"/>
        <mx:Image width="710" height="278.96207"
                source="@Embed('imagensComponentes/CanvasBaixo.jpg')"
                creationCompleteEffect="{wipeU}"
                scaleContent="false"
                right="10" verticalCenter="84.43103" autoLoad="true"
id="image2MainRight"/>

        <mx:TextInput width="214" height="20"
                id="mailingListBox" right="61" bottom="10"/>

                <mx:Button label="OK" labelPlacement="right"
                        fontFamily="Verdana"
                        fontWeight="bold"
                        width="42"
                        height="20"
                        fontSize="8"
                        right="10" bottom="11"/>
                <mx:Label fontFamily="myFont"
                        text="inscreva-se na mailing list"
                        color="#ffffff"
                        fontSize="11" bottom="10" right="283" id="label1"/>

</mx:Canvas>

#######################################################################33

NOTA IMPORTANTE: Apesar de eu ter mencionado a aplicação "Home" como
aplicação principal, na verdade não é, pois este será também um
componente a ser inserido noutra aplicação através de ViewStacks. No
entanto, penso que não é revelante dado que a transmissão de dados é
apenas feita dentro da aplicação "Home".

Agradeço a todos que tem coloborado na minha dúvida.

Obrigado
--~--~---------~--~----~------------~-------~--~----~
Recebeu esta mensagem porque está inscrito em Grupo "Mailing List da Comunidade 
Portuguesa de Desenvolvimento de RIAs - www.riapt.org" do Grupos Google.
 Para enviar mensagens para este grupo, envie um email para 
[email protected]
 Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED]
 Para mais opções, visite este grupo em 
http://groups.google.com/group/riapt?hl=pt-PT
-~----------~----~----~----~------~----~------~--~---

Responder a