热门文章 | 热门软件| 热门源码 | 热门电影 | 知识库 | 联系我们
软件 源码 教程 影视 健康 招聘
  HTML | JavaScript | ASP | PHP | JSP | NET | VB | VC | VF | Windows | Linux | Mysql | Mssql | Oracle | Struts 
当前位置: 创世纪计算机资源网 -> 文章频道 ->flash 
站内搜索:
Error: mx.rpc.http.mxml:HTTPService
作者:mrwicked 来源:bbs 整理日期:2007-10-11

I am quite new to flex so Ive been playing around with some tutorials. I am following one that searches flickr through flex and am getting this error:

1119: Access of possibly undefined property results through a reference with static type mx.rpc.http.mxml:HTTPService.

I have a red X on line9 (<mx:TileList.../>)

Here is my code. So it is obviously saying that my url tag in the HTTPServices isnt getting anything back, yet when you type it in the browser:

ex: *ttp://flickr.com/services/rest/?method=flickr.photos.search&api_key=3540c3ffb0e43 e5dc7ca2a40229713d9&per_page=9&tags=dog

it is being populated. So anyone know why it is returning undefined?


ActionScript Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:HTTPService id="service" url="http://flickr.com/services/rest/?method=flickr.photos.search&amp;api_key=3540c3ffb0e43e5dc7ca
2a40229713d9&amp;per_page=9&amp;tags={input.text}" />
    <mx:states>
        <mx:State name="results">
            <mx:SetProperty target="{panel1}" name="width" value="100%"/>
            <mx:SetProperty target="{panel1}" name="height" value="100%"/>
            <mx:AddChild relativeTo="{panel1}" position="lastChild">
                <mx:TileList dataProvider="{service.result.rsp.photos.photo}" width="97%" x="10" height="85%" verticalCenter="-2.5"></mx:TileList>
            </mx:AddChild>
        </mx:State>
    </mx:states>
    <mx:Panel width="329" height="80" layout="absolute" horizontalCenter="0" title="Photos" top="31" id="panel1" resizeEffect="Resize">
        <mx:Label x="10" y="10" text="Tags:"/>
        <mx:TextInput x="53" y="8" id="input"/>
        <mx:Button x="221" y="8" label="Find" click="currentState=results; service.send()"/>
    </mx:Panel>
   
</mx:Application>

thanks for any help.

.........................................................................................................................

Originally Posted by David
FYI for Flex 2 final you must change:

{reviewRequest.result.reviews.review}

to:

{reviewRequest.lastResult.reviews.review}

otherwise you will get a:

1119: Access of possibly undefined property result through a
reference with static type mx.rpc.http.mxml:HTTPService
相关文章