Question : IF THEN STATEMENTS (Flex 4)

I am creating a itemrenderer that contains information on event/concerts.
I have diferent info on diferent types of events.
Is it not possible to do somthing like IF THEN statements for TEXT og IMAGES and if possible, how?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
				xmlns:s="library://ns.adobe.com/flex/spark" 
				xmlns:mx="library://ns.adobe.com/flex/mx" 
				autoDrawBackground="true">


	<s:Panel x="0" y="0" width="200" height="200" dropShadowVisible="false" title="{data.ETITLE}">
		<mx:Image x="5" y="5" width="188" height="80" source="http://10.1.1.203/_img/events/front/evt_100.jpg"/>
		
		<mx:Text x="5" y="105" text="{data.EPRICE1}" />
		
		<mx:Text x="5" y="120" id="prist" text="{data.EPRICE1TYPE}" visible="true" />
		
	</s:Panel>
	
	
</s:ItemRenderer>

Answer : IF THEN STATEMENTS (Flex 4)

Aaaaahh ... ok the problem is that you don't have to provide the data element ... all you do is to procide the name of the function.
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:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minHeight="0" width="910" height="1000"
			   creationComplete="serviceEventList.send()">
	<fx:Declarations>
		<mx:HTTPService id="serviceEventList" url="http://10.1.1.203/asp/list/event_events_liste.asp" result="resultHandler(event)" fault="faultHandler(event)" />
	</fx:Declarations>
	<fx:Script>
		<![CDATA[
			import mx.collections.ArrayCollection;
			import mx.controls.Alert;
			import mx.rpc.events.FaultEvent;
			import mx.rpc.events.ResultEvent;
			
			[Bindable]
			private var eventList:ArrayCollection;
			
			private function resultHandler(event:ResultEvent):void {
				eventList = event.result.row;
				//Alert.show(eventList.getItemAt(0).EID.toString());
			}
			private function faultHandler(event:FaultEvent):void {
				Alert.show(event.fault.faultString, event.fault.faultCode);
			}
			
			private function listItemRendFunc(item:Object):ClassFactory {
				var cla:Class = event_liste;
				switch (item.type) {
					case "P1V":
						cla = event_liste;
						break;
					case "P1A":
						cla = event_liste2;
						break;
					default:
						break;
				}
				return new ClassFactory(cla);
			}
			
		]]>
	</fx:Script>
	
	<s:Button x="10" y="10.25" label="Button"/>
	<s:Button x="10" y="39.7" label="Button"/>
	<s:Button x="10" y="69.15" label="Button"/>
	<s:DataGroup x="105" y="14" width="700" height="200" dataProvider="{eventList}" itemRendererFunction="listItemRendFunc">
		<s:layout>
			<s:TileLayout/>
		</s:layout>
	</s:DataGroup>

</s:Application>
Random Solutions  
 
programming4us programming4us