E4X: No L♥ve for siblings

Since AS 3's XML access lacks completely on the sibling axis, i decided to roll my own wire for that:

public class XMLUtils
{
public function XMLUtils():void
{

}
//Alle Geschwister eines Knotens
public static function siblings(node:XML):XMLList
{
return node.parent().children();
}
//nächstes Geschwister
public static function nextSibling(node:XML):XML
{
return node.parent().*[node.childIndex() + 1];
}
//voriges Geschwister
public static function previousSibling(node:XML):XML
{
return node.parent().*[node.childIndex() -1];
}
}


Spreadsheet from Excel to Flash

My recent pet project for the summerhole is a spreadsheet rendering component that eats an Excel spreadsheet in Excels own XML format (Save as...> XML instead of XLS). The benefit of it will be that my employer often has data assembled in spreadsheet that need to be presented in Flash Desktop applications as tables.
So instead of all the past hacking data into variable-value txt-files or rolling my own XML structure I decided to look at Excels own XML Format since the spreadsheet is still editable in Excel leaving our text department with a well known frontend.

Getting the row/column/cell placement right was a bit of an adventure because Excel only generates nodes and attributes for them if they
a)have a defined width other than the standard or
b)are placed at a position (index)in the table that is different from their position in the node or
c)are repeated in the next/following coulumns respective their (other than standard) width as expressed with an attribute named "Span"...

Cells in a row can have a "MergeAcross" and a "MergeDown" attribute that needs to be handled so the next cell is placed at the proper column / the next row doesn't screw up with the cell placement/indexing.

Once I got a grip on that It was merely a matter of attribute checking to make the table appear like in Excel.
Some Style parsing later I had the basic formatting of the Excel cells showing up in Flash:
I read out the Font, Fontsize and Fontstyle (b,i,u) as well as the cell color and if it has borders.
As to the borders I only look up if the cell has a border tag since Flash TextFields do not specify on top,right,bottom and left borders and for the time being I didn't put in my own border drawing (KISS).

Anyway, ...drummroll... heres 2 pictures off a spreadsheet in Firefox(Flash) and Excel.












ps:the Flash Version implements BrowserCanvas. That is no Flash Scrollbar hazzle-make use of the browser window to adapt to your dynamic Flash content.
Yeah! Mr. White! SCIENCE! I ♥ that!

pps: I added cell align after Screenshots. excuse the laziness.

ppps: Since the code for this class was written at work, I cannot provide you with the source atm. sorry!

Namespace weirdness with AS3

For my recent pet project (Displaying an Excel Sheet in Flash) i ran into a strange behaviour along with namespace usage. The Class responsible for loading and displaying the XML had a namespace variable initialised and set later on once the XML loaded and the namespace therein was read. But now the main Timeline threw an error with every function telling me the namespace variable was not defined- WHAT THE **?

Soon as I declared the variable with a dummy value on the Main Timeline, my FLA compiled succesfully with no errors. Someone please explain that to me...