You might want to look into useing a ViewStack.  It is a nice way to
manage view states.  You can make a different MXML file for each of
your views.  Getting the different views to talk to each other can get
a bit tricky, but if you are using Cairngorm or a ModelLocator pattern
it can fairly easy.

Put your MXML views in the folder "views"
SplashView.as
IntroView.as
PatientSummaryView.as
InterviewPatientView.as

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

<mx:ViewStack id="stateViewStack" 
        creationPolicy="all"
        selectedIndex="0">
    <ns1:SplashView id="splashView" label="Splash"/>      
    <ns1:IntroView id="introView" label="Intro"/>    
    <ns1:PatientSummaryView id="patientSummaryView" label="Patient
Summary"/>
    <ns1:InterviewPatientView id="interviewPatientView"
label="Interview Patient"/>      
</mx:ViewStack>

</Application>

--jason

--- In [email protected], "Michel Scoz" <[EMAIL PROTECTED]> wrote:
>
> Hello there!
> 
> I'm creating a site administrator application, with too manys
inputs, classes, views, so on...
> 
> The MXML code is too large and its getting very complicated to
find/search through the code to edit/add States. Is there any way to
stop using states to switch views, and/or create a new file for new
States? Or maybe an easier way to organize them without having to
write all states in one file?
> 
> Here's what I have now...
> 
> -------------------
>  <mx:states>
>   <mx:State name="home">
>    <mx:AddChild position="lastChild">
>     <mx:Panel y="100" width="730" height="600" layout="absolute"
title="Área de Manutenção" horizontalCenter="-5" id="painelHome">
>      <mx:Panel y="10" width="165" height="225" layout="absolute"
title="Dicas da Vovó Lydia" x="10">
>       <mx:Image y="10" source="images/manut/lampada.png"
horizontalCenter="0"/>
>       <mx:LinkButton y="66" label="Adicionar" width="100%"
horizontalCenter="0" click="currentState = 'dicas_adicionar';"/>
>       <mx:LinkButton y="96" label="Editar" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="126" label="Estatísticas" width="100%"
horizontalCenter="0"/>
>      </mx:Panel>
>      <mx:Panel y="10" width="165" height="225" layout="absolute"
title="Concurso de Receitas" x="185">
>       <mx:Image y="10" source="images/manut/caixapapeis.png"
horizontalCenter="0"/>
>       <mx:LinkButton y="66" label="Aprovar" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="96" label="Editar" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="126" label="Estatísticas" width="100%"
horizontalCenter="0"/>
>      </mx:Panel>
>      <mx:Panel y="250" width="165" height="225" layout="absolute"
title="Livro de Receitas" x="185">
>       <mx:Image y="10" source="images/manut/livroaberto.png"
horizontalCenter="0"/>
>       <mx:LinkButton y="66" label="Adicionar" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="96" label="Editar" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="156" label="LinkButton" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="126" label="Estatísticas" width="100%"
horizontalCenter="0"/>
>      </mx:Panel>
>      <mx:Panel y="10" width="165" height="225" layout="absolute"
title="Viva Melhor" x="535">
>       <mx:Image y="10" source="images/manut/pessoabrilho.png"
horizontalCenter="0"/>
>       <mx:LinkButton y="66" label="Adicionar" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="96" label="Editar" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="126" label="Estatísticas" width="100%"
horizontalCenter="0"/>
>      </mx:Panel>
>      <mx:Panel y="250" width="165" height="225" layout="absolute"
title="Chamadas" x="10">
>       <mx:Image y="10" source="images/manut/speaker.png"
horizontalCenter="0"/>
>       <mx:LinkButton y="66" label="Página Inicial" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="96" label="Viva Melhor" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="126" label="Livro de Receitas" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="156" label="Receitas do Concurso"
width="100%" horizontalCenter="0"/>
>      </mx:Panel>
>      <mx:Panel y="10" width="165" height="225" layout="absolute"
title="ABC dos Alimentos" x="360">
>       <mx:Image y="10" source="images/manut/potelupa.png"
horizontalCenter="0"/>
>       <mx:LinkButton y="66" label="Adicionar" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="96" label="Editar" width="100%"
horizontalCenter="0"/>
>       <mx:LinkButton y="126" label="Estatísticas" width="100%"
horizontalCenter="0"/>
>      </mx:Panel>
>     </mx:Panel>
>    </mx:AddChild>
>   </mx:State>
> -------------------
> 
> 
> You see? This is just for the States... then there is the scripts,
styles, transitions and everything else. Its gonna get massive!!
> 
> I could create various mxml and switch between them with "getURL",
but this way dont sounds good as it will refresh the page loading
another. There is any other way?
> 
> Thank you in advance,
> Michel.
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to