I'm trying to read xml fields (with actionscript 3), but the problem is that I choose which field to read dynamically. For example, I may need to read test19
or test39
or test12
or anything else.
var value:Number = event.result.test19;
var value:Number = event.result.test39;
var value:Number = event.result.test12;
Is there a way to construct that event.result.test19
part dynamically? Something like the code idea below
var fieldname:String = "test19";
var value:Number = ("event.result." + fieldname) as Number;
I also tried casting as XMLNode ("event.result." + fieldname) as XMLNode
but it didn't work.
Anyone knows how this can be done?