All pastes #2090066 Raw Edit

Unnamed

public text v1 · immutable
#2090066 ·published 2011-10-14 14:04 UTC
rendered paste body
<?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"
			   creationComplete="application_creationCompleteHandler(event)" minWidth="955" minHeight="600">
	<fx:Script>
		<![CDATA[
			import mx.controls.Alert;
			import mx.events.FlexEvent;
			import mx.rpc.events.FaultEvent;
			import mx.rpc.events.ResultEvent;
			
			protected function application_creationCompleteHandler(event:FlexEvent):void{
				myRequest.send();
			}
			
			protected function myRequest_resultHandler(event:ResultEvent):void{
				myAc = event.result.rss.channel.item;
			}
			
			protected function myFault_resultHandler(event:FaultEvent):void{
				Alert.("Gegevens Not ok");
			}
		]]>
	</fx:Script>
	<fx:Declarations>
		<s:ArrayCollection id="myAc">
			
		</s:ArrayCollection>
		<s:HTTPService id="myRequest"
					   result="myRequest_resultHandler(event)"
					   fault="myFault_resultHandler(event)"
					   url="http://newsrss.bbc.co.uk/rss/sportonline_world_edition/front_page/rss.xml"/>
	</fx:Declarations>
	<s:Panel title="{myRequest.lastResult.rss.channel.title}">
		<s:DataGrid dataProvider="{myAc}" x="30" y="44" width="378" height="258" requestedRowCount="4">
			<s:columns>
				<s:ArrayList>
					<s:GridColumn dataField="title" headerText="Column 1"></s:GridColumn>
					<s:GridColumn dataField="description" headerText="Column 2"></s:GridColumn>
					<s:GridColumn dataField="pubDate" headerText="Column 3"></s:GridColumn>
				</s:ArrayList>
			</s:columns>
		</s:DataGrid>
	</s:Panel>
</s:Application>