Saturday, 27 September 2014

Fetching server results with Flex/ActionScript



I am trying to get the data provided by MyTSA (http://ift.tt/1DJzb78) for security line wait times, but I am having trouble with it. Here is the code that I have:



import mx.events.FlexEvent;
import mx.rpc.events.ResultEvent;

[Bindable]
private var url:String = "http://ift.tt/Ytfq2R";

protected function init(event:FlexEvent):void
{
getWaits.send();
}

protected function getWaitsResult(event:ResultEvent):void
{
data_label.text = getWaits.lastResult.toString();
}

]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:HTTPService id="getWaits" url="{url}" result="getWaitsResult(event)"/>


Whenever I run it, I get the error code: [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://ift.tt/YtforB" errorID=2032]. URL: http://ift.tt/YtforB"]


Any idea how I can get this to work? Am I doing something wrong?


Thanks, Jacob


No comments:

Post a Comment