Limitations in Actionscript 2.0 with LoadVars?

[SIZE=2]I’m basically making a stripped down version of photoshop in flash for web based application. It provides functionality like giving user the ability to drag and drop graphics on the canvas, resize text, images and a few vector shapes, upload images, drag and drop layers (which act as containers for graphics) and most importantly the ability to save and load files on the server. The mechanism I’ve set up for the save and load functionality uses an XML file structure which stores enough information for the application to collect all the design assets and recreate it. I use the LoadVars class to pass a string variable to a php script which saves it as an xml file. To load, there is a php script to open the xml file and read out its contents into the flash string variable which is then parsed as XML. This is where the limitation creates a problem. Upon reading the string variable off of POST, some barrier is hit either in the amount of information a php string object can store, how much can be stored in POST, or perhaps how much can be passed using the LoadVars Class (though there is no problem sending the same exact information to the php script).[/SIZE]
[SIZE=2]As long as I keep the xml files under 1000 characters long, everything is fine, however the string that receives the xml data from the php script is just cut off at the 1000 chars mark if it happens to contain more. This only allows me to have around 4-5 layers saved to a file for full functionality and that doesn’t do me any good.[/SIZE]
[SIZE=2]Well, here is the code for the load function:[/SIZE]

 
open.onRelease = function() {
infoField.text = "Downloading design...";
var send_lv:LoadVars = new LoadVars();
var result_lv:LoadVars = new LoadVars();
//tell it which file to load
send_lv.currentFile = currentFileName;
send_lv.sendAndLoad("OpenDesign.php", result_lv, "POST");
result_lv.onLoad = function(success:Boolean) {
if (success) {
var xmlFile:XML = new XML();
xmlFile.parseXML(result_lv.fromPHP);
debugField.text = result_lv.fromPHP;
infoField.text = "Design downloaded successfully...";
//find out how many objects there are
var numElements:Number = parseInt(xmlFile.firstChild.firstChild.firstChild.nodeValue, 10);
//parse the xml data and re-write the array according to parsed data
//*******************************************************************
 
Lots of code left out here....
This is where it parses the xml.
 
//******************************************************************* 
} 
else {
infoField.text = "Error connecting to server.";
};
};
//some unrelated code left out here
};

[SIZE=2]If anyone can help me find a way around this limitation, please help. In return I can hand over the source file when it’s completed. This is the only bug holding it back from being complete and it is a pretty cool application. [/SIZE]

yep - there is a limitation for LoadVars - since the data isn’t serialized. I don’t know of a what around that using LoadVars. However, for this amount of Data, I’d look into AMFPHP or some other 3rd party resource that serializes the data, is very quick, and can handle a LOT of data.

Hope this helps