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.
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.