blob: 373cd85c9f206767f2add0e3d23307be17eb8ecb [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<s:View xmlns:fx=""
xmlns:s="library://" title="HTTPService">
import mx.collections.XMLListCollection;
protected function loadRSS():void
if(textInput.text != ""){
rssService.url = textInput.text;
protected function rssResult(event:ResultEvent):void
itemsList.dataProvider = new XMLListCollection(new XMLList(;
protected function buttonHandler(event:MouseEvent):void
if(currentState == "DemoState"){
currentState = "InfoState";
}else if(currentState == "InfoState"){
currentState = "DemoState";
<s:State name="DemoState"/>
<s:State name="InfoState"/>
<s:MultiDPIBitmapSource id="aboutIcon" source160dpi="@Embed('assets/icons/160/about.png')" source240dpi="@Embed('assets/icons/240/about.png')" source320dpi="@Embed('assets/icons/320/about.png')"/>
<s:MultiDPIBitmapSource id="demoIcon" source160dpi="@Embed('assets/icons/160/dock.png')" source240dpi="@Embed('assets/icons/240/dock.png')" source320dpi="@Embed('assets/icons/320/dock.png')"/>
<s:HTTPService id="rssService" resultFormat="e4x" result="rssResult(event)"/>
<s:TextInput id="textInput" text="" prompt="Type any RSS 2.0 valid URL" skinClass="" includeIn="DemoState" enter="loadRSS()" y="10" left="5" right="70" height="40"/>
<s:Button label="Load" y="10" includeIn="DemoState" width="60" height="40" right="5" click="loadRSS()"/>
<s:List id="itemsList" labelField="title" includeIn="DemoState" width="100%" bottom="0" top="60"/>
<s:TextArea includeIn="InfoState" skinClass="" left="10" right="10" top="10" bottom="10" editable="false" text="You use the HTTPService tag to represent an HTTPService object in an MXML file. When you call the HTTPService object's send() method, it makes an HTTP request to the specified URL, and an HTTP response is returned. Optionally, you can pass parameters to the specified URL. When you do not go through the server-based proxy service, you can use only HTTP GET or POST methods. However, when you set the useProxy property to true and you use the server-based proxy service, you can also use the HTTP HEAD, OPTIONS, TRACE, and DELETE methods.
&#xd; &#xd;Note: Due to a software limitation, HTTPService does not generate user-friendly error messages when using GET."/>
<s:Button click="buttonHandler(event)" icon.DemoState="{aboutIcon}" icon.InfoState="{demoIcon}"/>