Central.onPowerOutage

Dude, that auto-save window panel being discussed on the Extend Flash (JSAPI/JSFL) List is looking mighty good right about now. Thankfully, I’m am obsessive compulsive with Control S, but damn. Coding, minding my own business, and poof, everything goes off. Got to spend some great time with my fiancee since we have a gas fire place so could still keep warm as the heat slowly seeped outta da hizzouse playing cards and just sitting and spending time talking together in the candlelit darkness.

However, after over an hour with no power, rather than gain an appreciation for the harsh lifestyles of my forefathers, instead I’m buying more candles, more flashlights, and a UPS.

Holy $h… they fixed it! Central Docs

I went to look for some method documentation and it seems the latest documentation update fixed the misnomers with the Central’s LCDataProvider class. They even fixed the examples too! ++Score Macromedia.

It was just surprising to see my docs had changed in the refernce panel before my very eyes.

SWG Resource Viewer – A Central App

Nothing amazing; simply parses an XML file and displays the data in an interface. Working on a preference panel to customize the fields the data grid displays as well as some controls on searching through the data.

Currently hits a 2 day old (1 week lifespan) cached XML file from <a href=”http://www.swgcraft.com/”>SWGCraft.com</a> for the Tarquinas server.

<a href=”https://www.jessewarden.com/SWGCraft/”>https://www.jessewarden.com/SWGCraft/</a>

Source:
– <a href=”https://www.jessewarden.com/SWGCraft/secretAgent2.fla”>secretAgent2.fla</a>
– <a href=”https://www.jessewarden.com/SWGCraft/app.fla”>app2.fla</a>
– <a href=”https://www.jessewarden.com/SWGCraft/interface.as”>interface.as</a>
– <a href=”https://www.jessewarden.com/SWGCraft/test.xml”>test.xml</a> (copied from <a href=”http://www.swgcraft.com/”>SWGCraft.com</a>)
– <a href=”https://www.jessewarden.com/SWGCraft/test.php.txt”>test.php.txt</a> (I highly suggest you do NOT use this; instead, just view the code. The XML files he has are huge, and his server traffic is limited)
– fields.fla (still working on for preferences)

Central: Paging 1, onEnterFrame 0, while 0 + Tip

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?