Bonjour,
est il possible qu'un itemrenderer d'une tilelist comporte des images de tailles différentes?
Version imprimable
Bonjour,
est il possible qu'un itemrenderer d'une tilelist comporte des images de tailles différentes?
Si tu donnes une taille en entrée à ton itemRenderer ça doit être possible je suppose :
Code:
1
2
3
4
5
6
7
8
9
10
11 <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" verticalAlign="middle" width="{data.width}" height="{data.height}" > <mx:Image source="{'assets/'+data.image}"/> </mx:Canvas>
oui mais moi mon renderer est en actionscript.
Donc je ne sais pas ou le mettre dans les propriétés...Code:
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 public function set data(value:Object):void { invalidateProperties(); var valeur:String; valeur= new String(); _data = value; valeur= (int(9*Math.random())).toString(); //Alert.show(valeur); //box.setStyle("backgroundColor","0x99"+valeur+"001"); //box.setStyle("backgroundColor","0"); //editImg.source=_data.image; //dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE)); } public var editImg:Image; public var test:Label; public var box:HBox; public var panel:Panel = new Panel; public var titreVideo:String = new String; public var test1:Label; //ajouter au renderer des images override protected function createChildren():void { super.createChildren(); //Alert.show("ici"); box= new HBox(); box.width=110; box.height=70; addChild(box); editImg = new Image(); editImg.width=110; editImg.height=70; addChild(editImg); test = new Label(); test.width=10; test.height=10; test.setStyle("color",0x00FF00); //test.visible=false; test.addEventListener(MouseEvent.CLICK, handleImageClick) addChild(test); } // adapte les composants du renderer aux composants images override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number ) : void { super.updateDisplayList(unscaledWidth, unscaledHeight); box.move(0,0); // box.setActualSize(unscaledWidth,unscaledHeight); editImg.move(0,0); //editImg.setActualSize(unscaledWidth,unscaledHeight); test.move(0,0); test.setActualSize(unscaledWidth, unscaledHeight); }