Ok, have this seriously, insanely large XML file I’m parsing in my agent. I parse it, and then popluate the data to my LCDataProvider so anyone who wants some gets some.
The while loop is kind of slow as the XML is huge, and it’s pretty rude if someone goes to/launches another app while my agent is chugging away.
I then tried a process movie clip to cycle through each child of the XML using an onEnterFrame, and during each iteration, adding a small array to the LCDataProvider. However, the loop was slow enough to chug it to 1 fps about, and the DataGrid updated at the same rate… pretty lame even for a capped 4 items (hardcoded to test). I’m assuming this is because LCDataProvider is a syncronous LocalConnection plus the added overhead of modelChanged events getting thrown around.
So, went back to my for loop (while, faster, I know, but it’s late…), and it’s faster overall, just more CPU. Now I can see why “paging”, as it’s called is the way to go. Besides, the data I’m displaying, resource data based on type + planet + galaxy… no one’s gonna want to look at a 100 itemed DataGrid anyway.
People say don’t reivent the wheel, but I hate that. That’s the very reason I did so horrible in math in school… no teacher could explain why the hell I needed to know how to do this, nor why you did something the way you did it. Obviously, that shiot didn’t fly in Geometry or Trig. At any rate, by learning the hard way, I now have a great appreciation for paging, and will have to open up MX again to see how the RecordSet object does it for Flast Remoting, and hopefully, glean some applicational uses for the future.
<b>Tip</b>
Aside from my LCService mistake, another thing was I kept publishing Directly to the Central directory where it was installed. I forgot that the FLA saves that filepath you set in the File Publish settings, and I was uploading more than SWF’s (xml, php) to my server, so was wondering why everytime I reinstalled, I wasn’t seeing changes, until I put a text field on the stage, and didn’t see it… then I knew… 2 hours later. Just another gotcha to watch out for. Not to mention the fact that WS_FTP Lite wasn’t updating SWF’s that resided in a folder. …but hey, it’s free, right?