I’ve spent several hours on this already and I can’t remember the last time I got so frustrated by anything Actionscript related. If anyone can help, and thus prevent me launching my monitor through the office window, it would be hugely appreciated.
I have an XML file loaded at run time. Among others, it contains several nodes which contain a name attribute and a value attribute. I want to be able to select name by value and vice versa.
If I try and trace out a name by selecting its value, I get exactly what I expected:
[AS]
trace( "NAME: " + SiteModel.instance.constants.(@value==section).@name );
[/AS]
But, and this is what I’ve been screaming at for most of the morning, if I try and assign that name to a variable, and trace the variable, I get epic fail:
[AS]
var n:String = SiteModel.instance.constants.(@value==section).@name;
trace( "NAME: " + n );
[/AS]
Trying to trace that variable results in a TypeError:
TypeError: Error #1010: A term is undefined and has no properties.
This is stupifyingly ridiculous in my opinion, so If someone has any ideas they are more than welcome.