Custom traces in AS3

At least a year ago I created an AIR version of ZLog. I've been using it myself and also some workmates at the office, but never found time to release it officially. Precisely one of my ex-workmates sent me an email last week complaining about it wasn't working with latest version of AIR and that was the kick in the butt I needed. So here it is: ZLog AIR. From now onwards each ZLog release will come as an AIR package too.

About the future of ZLog, I don't know what to do :| For starters, Flex SDK compiler doesn't provide a simple way of re-routing your traces to a custom trace. That plain sucks. They only needed to mimic what MTASC does, pre-process your code and substitute any trace call with calls to your custom trace function. I find that extremely useful and flexible, specially working in teams. What if I want to work with ZLog and someone else wants to work with Xray? That was easy to do in MTASC, almost impossible in AS3 + Flex SDK.

Everything I've read about custom traces in AS3 ends up saying:

Create a package function and call it from anywhere in your code


Well, that's certainly possible but not near as good as MTASC behaviour and I really miss it. On top of that, when I've tried ZLog for AS3, I've always found problems. Don't know what it is yet, but the player stops running after a couple of calls. Might be related to very fast consecutive LocalConnection calls, I don't know. I have to spend some time looking to this.

BTW, while I was creating the AIR version, I've run across the very famous AIR 303 error. It happens when you try to define custom icons for your AIR application, check out this bug. All references I've found out there are related to Flex Builder, but I was compiling with AIR SDK, so the solution didn't apply. I finally solved it telling the compiler to include the icons' folder too (complete script):

[code lang="dos"]adt -package ... ZLog.air air-descriptor.xml ZLog.html elements icons[/code]

Hope this helps!

Back to index