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.