I'm working on a project and have come to a bit of an issue due to a limitation of the backend I'm using for me program.
First of all my question is "can I measure the data size of text through URLLoader?".
I'm making an app that is required to receive and send a fair bit of data, but the back end I'm using has limited to me only being able to send 1024 at a time.
The backend is called 'Scoreoid', it's really good for games and user management and such, but i'm using it in a bit of a different way.
All the a side, my issue is, I'm sending data through an array, and I can easily enough break up the array and send it in multiple transactions... but is there a way I can measure the size of the data?
That way I could determine how much of the array I can send at a time.
Here is the code they provide:
function getGame():void
{
var url:String = "API URL";
var request:URLRequest = new URLRequest(url);
var requestVars:URLVariables = new URLVariables();
request.data = requestVars;
requestVars.api_key = "YOUR API KEY";
requestVars.game_id = "YOUR GAME ID";
requestVars.response ="XML"
requestVars.username ="Players Username"
requestVars.key ="Your Key"
requestVars.value ="Key Value"
request.method = URLRequestMethod.POST;
var urlLoader:URLLoader = new URLLoader();
urlLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.TEXT;
urlLoader.addEventListener(Event.COMPLETE, loaderCompleteHandler);
urlLoader.load(request);
}
function loaderCompleteHandler(event:Event):void
{
trace("responseVars: " + event.target.data);
}