Bonjour à tous,
J'aurais besoin des lumières de quelqu'un qui aurait percé les mystères des effects en Flex
J'ai une application (simplifiée au maximum) dont voici le code source :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:com="com.*" xmlns:views="pfp.views.*" xmlns:cas="cas.*"
layout="vertical" width="100%" height="100%" horizontalAlign="left">
<mx:ApplicationControlBar id="connecteur" width="100%">
<mx:Button label="Connection" click="seq.play()"/>
</mx:ApplicationControlBar>
<mx:Sequence id="seq" duration="500">
<mx:Move target="{connecteur}" yTo="-40"/>
<mx:Move target="{panel}" yTo="{connecteur.y}" effectEnd="connecteur.includeInLayout=false; connecteur.visible=false"/>
<mx:Resize target="{panel}" heightTo="{panel.y - connecteur.y + panel.height}"/>
</mx:Sequence>
<mx:Panel id="panel" height="100%">
<mx:DataGrid height="100%"/>
</mx:Panel>
</mx:Application> |
L'effet souhaité est de voir la barre de connection se dérober vers le haut tout en faisant en sorte que le reste de l'application occupe toute la place désormais disponible.
Ça fonctionne exception faite que les trois effets s'exécutent en séquence alors que j'aimerais qu'ils s'éxécute de manière synchrone.
Et c'est sur ce point que je coince depuis 3 jours...
Ce que j'ai déjà pu tester sans succès :
- Remplacer <mx:sequence> par <mx:parralèle>
- Utiliser les changements d'états + Transitions
- Laisser mon panel se redimentionner tout seul en définissant simplement son attribut "resizeEffect" (histoire de maitriser la "duration")
Hélas aucune de ces solutions n'a porté ses fruits.
Exemple de solution qui ne fonctionne pas :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:com="com.*" xmlns:views="pfp.views.*" xmlns:cas="cas.*"
layout="vertical" width="100%" height="100%" horizontalAlign="left">
<mx:ApplicationControlBar id="connecteur" width="100%">
<mx:Button label="Connection" click="currentState = 'connecté'"/>
</mx:ApplicationControlBar>
<mx:states>
<mx:State name="connecté">
<mx:RemoveChild target="{connecteur}"/>
</mx:State>
</mx:states>
<mx:transitions>
<mx:Transition fromState="*" toState="connecté">
<mx:Sequence>
<mx:SetPropertyAction target="{connecteur}" name="includeInLayout"/>
<mx:Parallel targets="{[connecteur, panel]}" duration="500">
<mx:Move target="{connecteur}" yTo="-40"/>
<mx:Move target="{panel}" yTo="{connecteur.y}"/>
<mx:Resize target="{panel}" heightTo="{panel.y - connecteur.y + panel.height}"/>
</mx:Parallel>
<mx:RemoveChildAction target="{connecteur}"/>
</mx:Sequence>
</mx:Transition>
</mx:transitions>
<mx:Panel id="panel" height="100%">
<mx:DataGrid height="100%"/>
</mx:Panel>
</mx:Application> |
Je serai vraiment reconnaissant à toute personne pouvrant me venir en aide !
Excellente journée à tous,
Anthony.
Partager