PDA

View Full Version : Flex Error #1034



natdrip
November 4th, 2008, 08:39 PM
I get this error :hair:


TypeError: Error #1034: Type Coercion failed: cannot convert fl.controls::List@2db810c1 to flash.display.MovieClip.
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at catalog_fla::MainTimeline()

This is my code



import fl.data.DataProvider;

var productsURL:URLRequest = new URLRequest("products.xml");
var xmlLoader:URLLoader = new URLLoader(productsURL);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);

var productsXML:XML = new XML();
productsXML.ignoreWhitespace = true;

function xmlLoaded(evt:Event):void
{
productsXML = XML(xmlLoader.data);
//trace(productsXML);
var aCategory:Array = new Array();
for(var category:String in productsXML.category)
{
var categoryName:String = productsXML.category[category].@name;

aCategory.push(categoryName);
}


var dpCategory:DataProvider = new DataProvider(aCategory);
liCategory.dataProvider = dpCategory;
}


thanks for your help

bzouchir
November 4th, 2008, 10:21 PM
Please post your entire code to be able to help.
The error doesn't appear to be in this block.

natdrip
November 5th, 2008, 01:10 PM
the only other thing I have on stage is a list box component!

the xml is fine it traces perfectly

okay I removed the component from the stage and the error stopped

I put the component back on the stage with no name and the error stopped

once I named the component the error started happening???

Any suggestions?

natdrip
November 5th, 2008, 01:58 PM
okay this has been resolved:

For anyone getting this error you are having a naming conflict.

Here I accidentally named my background movie "liCategory" this is what was causing the conflict

Thanks
For all your help :ya_rly: