View Full Version : custom item renderer - (changing data)

Mortimer Jazz
10-24-2006, 09:22 AM
[Edit - sorted - see below]
I am creating a thumbnail gallery using the TileList, and so I have created a custom item renderer comprising of a preloader, image component and text component.

The XML I would like to use is this:

<imageNode picURL="img0.jpg">Some Text Here</imageNode>

From within the itemRenderer I can trace the "data" property, which equals "Some Text Here". This data object doesn't seem to have reference to my picURL attribute, so, without changing the format of my XML, I'd ideally like to change what "data" is sent to my item renderer. Any ideas?

Mortimer Jazz
10-24-2006, 09:39 AM
Going to answer my own question again...

"data" comes in as ab object. I could see my node (including picURL) was being sent in (by using the bebug mode), so I realised I simply needed to cast:

trace(data); //Some Text Here
trace(XML(data.@picURL)); //img0.jpg