Thursday, March 18, 2010

AS3 XMLList and default namespaces

There have been many days where I have relished in how easy Actionscript is to use and how advanced it is as a programming language. Today was not one of those days.

Ever tried to use the XMLList class with XML containing a default namespace? If you have, you already know what I am going to say. If you haven't, you need to know. It doesn't work right!

Nothing happens, literally. The XMLList will just be empty. You have 2 choices at this point. You can set the default namespace using default xml namespace = someNamespace, but that requires setting it back in the same function using default xml namespace = ''. If you don't, be prepared to see errors about accessing invalid registers. Why? Because you are changing the default namespace which has ramifications outside of your little block of code.

The only suitable option is to fully qualify your objects using the namespace. So instead of a accessing an element with myxml..myelement, you must now use myxml..myNamespace::myelement.

I probably could have spent more time on this blog post, but I spent most of my day dealing with the problem being described. Need more info or help? Let me know and I'd be glad to help.

Friday, February 12, 2010

first blog

Finally got a blog up and running! Have a backlog a mile long of things people always said I should blog about...probably won't ever get to them though.

And so for my first blog...

Had a great time last night participating in the Carolina Hurricanes St. Baldrick's event. Organized a team of fellow rPath-ians to get our heads shaved for the cause. We raised over $1,200 dollars along the way!

We got to go on the ice after the game (a 4-3 OT victory for the 'Canes over the Sabres) for a picture of everyone. Was great to be down there! Checked Ben into the boards...it was a clean hit!

Thanks to everyone who participated and/or donated!