Monthly Archives: February 2009

Syntax of Java 5 Vs ActionScript 3

Chanced upon this very useful post by Yakov fain from Farata Systems

“Comparing the syntax of Java 5 and ActionScript 3”

Its a long list to be included in this post, but the list is worth going through. Now this gives me a better reason to taste java fx also, slurp..

Recursive XML parsing in Flex

When I had to parse a long book.xml for CD Splitter tool I was working on recently, I had a hard time to get the xml parsed effectively and with minimum code lines.  And I was hell bent, that i’ll not bother the good old friend google for this. Finally, after few attempts I got the solution.

private function onTemplateXMLLoad(event:ResultEvent):void

{

parseTemplateXML(XML(event.result));

}

private function parseTemplateXML(objXML:XML):void

{

if(objXML != null)

{

for each(var item:XML in objXML.children())

{

// trace("hasComplexContent*** : "+item.hasComplexContent());

if(item.hasComplexContent())

{

// recursive call

parseTemplateXML(item);

}

else

{

// this is the node value you are seeking

}

}

}

}