We are developing multiplayer game where we show user's Avatar image. It is working fine only if i have an avatar image before loading the game for the first time. After that, if i add/change or even if i remove my avatar image from yahoo, it is not being updated. Please help me in solving this. Here is my code.
- Code: Select all
private function loadYahooDisplayPic(yahooID:String):void
{
if(this.yahoo) {
this.yahoo.profiles.loadProfiles([yahooID], onProfileLoadSuccess, onProfileLoadError);
}
}
private function onProfileLoadError(error:PlayerIOError):void
{
trace("Profile load error : " + error.message);
}
private function onProfileLoadSuccess(profiles:Array):void
{
var imageURL:String = profiles[0].avatarUrl;
var urlReqObj:URLRequest = new URLRequest();
urlReqObj.url = imageURL;
var loaderObj:Loader = new Loader();
loaderObj.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loaderObj.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loaderObj.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
loaderObj.load(urlReqObj);
}