Bonjour,
J'ai un composant image dans ma page, en plus j'ai 2 boutons.
Chaque bouton fais changer l'image (c'est simpliste, mais c'est pour apprendre).
Le code:
Quand j'appuie sur bouton 1 ça me met l'image img001.jpg et si bouton 2 img002.jpg.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 <mx:Script> <![CDATA[ import flash.geom.*; import flash.display.*; [Bindable] public var sourcePath:String; private function bouttonOne():void { sourcePath = "com\\img\\img001.jpg"; } private function bouttonTwo():void { sourcePath = "com\\img\\img002.jpg"; } ]]> </mx:Script> <mx:Image x="10" y="68" width="338" height="222" id="imagePrinted" source="{sourcePath}"/>
Ca marche fonctionnellement c'est ok.
Mais esthétiquement c'est moche, en fait quand l'image change j'ai un "clignotement", j'imagine normal vu ma méthode, mais la je vois pas comment faire pour améliorer le truc, faire un fondu par exemple?
Merci
PS: si ma méthode est mauvaise, ce qui est possible, n'hésitez pas a en proposer d'autre.
Partager