Why am I getting an error?
How do I build a file for this error?
I'm trying to understand and can't, what's wrong here? Or how do I create a file with its parameters? Or how do I know what the parameters should be in this file?
I would love to help!
I would love to help!!!!!
package com.vtweens.components.website.server_requests.register
{
import com.adobe.serialization.json.JSONDecoder;
import com.vtweens.consts.ITEM;
import com.vtweens.dataobjects.item.ImageItemNoCache;
import com.vtweens.shell.ServerConfig;
import com.vtweens.util.Log;
import com.vtweens.util.Map;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
public class GetRegistrationItemsRequest extends EventDispatcher
{
private static var itemsBoy:Map = new Map();
private static var itemsGirl:Map = new Map();
private static const MAX_RETRIES = 2;
private var serverConfig:ServerConfig;
private var secure;
private var gender;
private var retries = 0;
public function GetRegistrationItemsRequest(param1:ServerConfig, param2:Boolean)
{
super();
this.serverConfig = param1;
this.secure = param2;
}
public static function getItemImage(param1:Object, param2:String = ".") : Sprite
{
if(param1)
{
return new ImageItemNoCache(param1[ITEM.TYPE],param1[ITEM.ORDINAL],param1[ITEM.ID],param1[ITEM.INVENTORY_TYPE],null,null,param2);
}
return new Sprite();
}
public function sendRequest(param1:int) : void
{
var _loc2_:URLVariables = null;
this.gender = param1;
if(param1 == 1 && itemsBoy.size() > 0 || param1 == 2 && itemsGirl.size() > 0)
{
dispatchEvent(new Event(Event.COMPLETE));
}
else
{
_loc2_ = new URLVariables();
_loc2_.gender = param1;
this.sendInqueryRequest(_loc2_,this.onRequestResponse,this.onRequestError);
}
}
private function onRequestError(param1:IOErrorEvent) : void
{
param1.target.removeEventListener(Event.COMPLETE,this.onRequestResponse);
param1.target.removeEventListener(IOErrorEvent.IO_ERROR,this.onRequestError);
Log.error("AllProductsRequest: onRequestError error:" + param1.text);
if(this.retries < MAX_RETRIES)
{
++this.retries;
Log.error("AllProductsRequest: Retying (" + this.retries + ")");
this.sendRequest(this.gender);
}
else
{
dispatchEvent(new IOErrorEvent(IOErrorEvent.IO_ERROR));
}
}
private function onRequestResponse(param1:Event) : void
{
var _loc3_:* = undefined;
var _loc4_:Object = null;
param1.target.removeEventListener(Event.COMPLETE,this.onRequestResponse);
param1.target.removeEventListener(IOErrorEvent.IO_ERROR,this.onRequestError);
var _loc2_:Array = new JSONDecoder(param1.target.data).getValue();
for each(_loc3_ in _loc2_)
{
_loc4_ = new JSONDecoder(_loc3_).getValue();
if(this.gender == 1)
{
itemsBoy.put(int(_loc4_[ITEM.ID]),_loc4_);
}
else
{
itemsGirl.put(int(_loc4_[ITEM.ID]),_loc4_);
}
}
dispatchEvent(new Event(Event.COMPLETE));
}
public function get itemsMap() : Map
{
if(this.gender == 1)
{
return itemsBoy;
}
return itemsGirl;
}
public function getItemsObjByType(param1:int) : Array
{
var _loc4_:* = undefined;
var _loc2_:Array = [];
var _loc3_:* = this.gender == 1 ? itemsBoy.getValues() : itemsGirl.getValues();
for each(_loc4_ in _loc3_)
{
if(int(_loc4_[ITEM.TYPE]) == param1)
{
_loc2_.push(_loc4_);
}
}
return _loc2_.sortOn(ITEM.ORDINAL,Array.NUMERIC);
}
private function sendInqueryRequest(param1:URLVariables, param2:*, param3:*) : *
{
var _loc4_:URLRequest = null;
var _loc5_:URLLoader = null;
(_loc4_ = new URLRequest(this.serverConfig.getRegistrationItemsUrl(this.secure))).contentType = "text/html; charset=utf-8";
_loc4_.method = URLRequestMethod.GET;
_loc4_.data = param1;
(_loc5_ = new URLLoader()).addEventListener(Event.COMPLETE,param2);
_loc5_.addEventListener(IOErrorEvent.IO_ERROR,param3);
_loc5_.load(_loc4_);
}
} }