Apache flex Flex-HTTPRequest在TextArea中输出html源代码
我有一个TextArea,我正试图使用HTTPRequest获取一个网站并输出html源代码 在文本区域,但什么都没有发生Apache flex Flex-HTTPRequest在TextArea中输出html源代码,apache-flex,actionscript,httprequest,Apache Flex,Actionscript,Httprequest,我有一个TextArea,我正试图使用HTTPRequest获取一个网站并输出html源代码 在文本区域,但什么都没有发生 <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:ns1="*" actionBar
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:ns1="*"
actionBarVisible="true" currentState="landscape" tabBarVisible="false"
overlayControls.landscape="false"
tabBarVisible.landscape="false"
actionBarVisible.portrait="true" viewActivate="view1_viewActivateHandler(event)">
<fx:Declarations>
<s:HTTPService id="service" resultFormat="e4x"/>
</fx:Declarations>
<s:TextArea id="mainTextField" text="{service.lastResult}"/>
<fx:Script>
<![CDATA[
import spark.events.ViewNavigatorEvent;
protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
{
service.url = "http://www.google.com";
}
]]>
</fx:Script>
<s:actionContent>
</s:actionContent>
<s:titleContent>
</s:titleContent>
</s:View>
您应该调用service.send()
来发送请求。顺便说一句,对于其他有此问题的人,我还必须将resultFormat=“e4x”更改为resultFormat=“text”