XML Simplify Code - HELP please!!
Hi,
I have to repeat the follow code 4x5 times currently....
t_factor = rc_xml.p.rc.(@id == t_type).pduration.pfactor;
t_base = rc_xml.p.rc.(@id == t_type).pduration.pbase;
t_min = rc_xml.p.rc.(@id == t_type).pduration.pmin;
t_start = rc_xml.p.rc.(@id == t_type).pduration.pstart;
t_end = rc_xml.p.rc.(@id == t_type).pduration.pend;
I'm trying to do the following:
var myArray_1:Array = new Array("pduration", "poutfit", "pbackground", "ppax");
var a:int = 0;
for (a=0; a<4l a++)
{
t_factor = rc_xml.p.rc.(@id == t_type).myArray_1[i].pfactor;
t_base = rc_xml.p.rc.(@id == t_type).myArray_1[i].pbase;
t_min = rc_xml.p.rc.(@id == t_type).myArray_1[i].pmin;
t_start = rc_xml.p.rc.(@id == t_type).myArray_1[i].pstart;
t_end = rc_xml.p.rc.(@id == t_type).myArray_1[i].pend;
}
PROBLEM is that Flash won't accept the VARIABLE myArray[i] in place of the element name?
Can someone please advise ;-)
Thanks,
Johann