Hello flash enthusiasts,
I am currently building a (mock up) to view subscriber information by duplicating a movie clip based on an array. I'm grabbing the data from an xml and trying to pass the array to duplicated clips. The problem I'm running into is that I can only get data to the first duplicated movie and the original remains blank.
Here is the xml:
Here is how I'm loading the xml:Code:<?xml version="1.0" encoding="utf-8" standalone="yes"?> <content> <article> <last4id>1111</last4id> <fnameid>fname1</fnameid> <lnameid>lname1</lnameid> <expdate>11/11</expdate> <addressid>1111 First St</addressid> <cityid>Los Angeles</cityid> <stateid>CA1</stateid> <zipid>11111</zipid> </article> <article> <last4id>2222</last4id> <fnameid>fname2</fnameid> <lnameid>lname2</lnameid> <expdate>22/22</expdate> <addressid>2222 Second St</addressid> <cityid>San Francisco</cityid> <stateid>CA2</stateid> <zipid>22222</zipid> </article> </content>
And on the next frame I'm running a for loop:Code:function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; last4id = []; fnameid = []; lnameid = []; expdate = []; addressid = []; cityid = []; stateid = []; zipid = []; total = xmlNode.childNodes.length; for (i=0; i<total; i++) { last4id[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; fnameid[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue; lnameid[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue; expdate[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue; addressid[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue; cityid[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue; stateid[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue; zipid[i] = xmlNode.childNodes[i].childNodes[7].firstChild.nodeValue; } nextFrame(); } else { trace("Can not load edit card xml"); } } xmlData = new XML(); xmlData.ignoreWhite = true; xmlData.onLoad = loadXML; xmlData.load("edittest.xml");
I'm wondering if I'm missing an initial load step or that I'm not splitting the array correctly.Code:for (i=1; i<total; ++i) { item_mc.info_mc.duplicateMovieClip("info_mc"+i, i); item_mc["info_mc"+i]._y = item_mc["info_mc"+i]._height+15; item_mc["info_mc"+i].fname.text = fnameid[i]; item_mc["info_mc"+i].lname.text = lnameid[i]; item_mc["info_mc"+i].cdigits.text = last4id[i]; item_mc["info_mc"+i].cdate.text = expdate[i]; item_mc["info_mc"+i].caddress.text = addressid[i]; item_mc["info_mc"+i].ccity.text = cityid[i]; item_mc["info_mc"+i].cstate.text = stateid[i]; item_mc["info_mc"+i].czip.text = zipid[i]; }
Any and all help is greatly appreciated and thank you for taking a moment to look at this post.
Thanks,
Kumba


Reply With Quote


Bookmarks