项目渲染器在完成执行代码之前加载
大家好,我遇到了项目渲染器的问题。我有一个数据组,显示 facebook 上人员的个人资料图片。我也拉取他们的状态,但我在项目渲染器内执行此操作。
FacebookDesktop.api(data.status_id,handle_data);
现在发生的情况是状态混合在一起。只有少数人人们确实会看到他们的真实状态,而其他人会得到其他人的状态。我猜那是因为 Flash 构建器在我收到 Facebook 服务器的回调之前执行代码,这就是状态不同步的原因。
这个问题有解决办法吗?比如在获取所有数据之前停止项目渲染器的处理? 我知道我可以在主程序中提取数据,但我问是否有办法在项目渲染器中执行此操作以供将来使用
10x!
10x 为你的答案,但我在使用类时仍然遇到同样的问题。因为无法知道何时会从 Facebook 服务器收到回电。用于 flash 的 facebook api 的问题是,您在与发送呼叫的函数不同的函数中获取信息/
我不能这样做:
return FacebookDesktop.api(id+"",profilepic, {
fields:"picture",type:"large"
});
所以发生的情况是我需要从函数 profilepic 返回信息,但是我不知道它是否已经获得数据。
Hi guys Ive got a problem with item renderer.I have a data group that displays profile picture of people on facebook.Im also pulling their status but I do that inside the item renderer
FacebookDesktop.api(data.status_id,handle_data);
Now what happens is that the statuses are mixed up.Only few people are really shown their true status and the others get other people status.Im guessing thats because Flash builder executes the code before i get a call back from Facebook server, and thats why statuses arent synchronized.
Is there a solution for this problem? like stopping the item renderer from processing before he get all data?
Iunderstand i can pull the data in the Main program, but im asking if theres a way to do that inside the item renderer for future uses
10x!
10x for your answer, but im still experiencing the same problem when using class. because theres is no way of knowing when ill get the call back from the Facebook server. The problem with facebook api for flash is that you get the info in a diffrent function from the one your send the call/
i can't do that:
return FacebookDesktop.api(id+"",profilepic, {
fields:"picture",type:"large"
});
so what happens is that i need to return the info from the function profilepic, but i have no idea if it already got the data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
项目渲染器不是用于处理数据,而是用于渲染已处理的数据。我要做的是创建一个类来处理这些数据并将对象添加到您的数据提供程序中,以便渲染器可以访问数据。
Item renderers are not for processing data they are for rendering the data thats been processed. What I would do is create a class that will processes this data and add the object to your dataprovider so that the renderer will have access to the data.