Error #1034: Type Coercion failed: cannot convert “” to Array

neronkadir

New Member
Having difficulty grabbing data from an XML and putting it into an Array.At the start of my document my array looks like this:\[code\]// MC's in library with exported for AS with class names "page1", "page2", etc.var pageArray:Array = [new page1(), new page2(), new page3(), new page4(), new page5()];\[/code\]Which all works well and fine when I navigate through the array.Then my problem comes when I try to replace that array with a new array from an XML file, from within a MovieClip.\[code\]/..xml details etc../var pages_xml:String = xmlData.account.(@code == String(codeField.text)).pages;MovieClip(root).pageArray = pages_xml;\[/code\]An example of a line from my XML would look like this.\[code\]<account code="1"><accountName>Account1</accountName><pages>new page1(), new page2()</pages></account>\[/code\]So from my example above you can see that I'm just trying to replace new page1(), new page2(), new page3() with new page1(), new page2()But doing so results in this error:\[quote\] TypeError: Error #1034: Type Coercion failed: cannot convert "new page1(), new page2()" to Array.\[/quote\]I know the best way would probably be to splice or something but the arrays will be getting messy later on and I will probably over up to 50 pages (a different selection of pages for each account code).Would appreciate any ideas on what I can do or what I am doing wrong.
 
Back
Top