XML Attributes to Object Properties

Now I can copy and paste this code instead of having to remember a.name().toString();

Anyway – this takes
var x : XML =
<node name=’Doug’ hadAGoodTimeSleddingOnSunday = ‘true’/>
to
o.name = “Doug”;
o.hadAGoodTimeSleddingOnSunday = “true” //yup you’d want to type that as a Boolean.

var o : Object = {};
var atts : XMLList = x.attributes();
for each (var a : XML in atts) {
var propName : String = a.name().toString();
o[propName] = a.toXMLString();
}

Todd Anderson at Design Patterns (Flash and Beer)

Todd Anderson will be speaking about Inversion of Control this week at the Design Patterns Group (or the Flash and Beer group). Todd spoke at MAX this year and co-wrote Air: Create, Modify, Reuse and The Flash 3 Cookbook. He is a Senior Software Engineer at Infrared5.

This month’s meeting is a week late due to weather (safety first!!).

Wednesday January 14, 7pm at Brightcove top floor.

Map here.

This month’s beers: Dogfish Head, Spaten, La Chouffe, and whatever looks good at the store on my way to the meeting.