Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex Flex-HTTPRequest在TextArea中输出html源代码_Apache Flex_Actionscript_Httprequest - Fatal编程技术网

Apache flex Flex-HTTPRequest在TextArea中输出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

我有一个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="*"
        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”