Hello,

 

Have you tried :

 

import mx.core.ClassFactory;

 

myTitle.itemRenderer = new ClassFactory( myThumbnail );

 

this should work, you have to use ClassFactory because an itemRenderer should receive an object that implement IFactory ,

 

cheers

 


From: [email protected] [mailto:[email protected]] On Behalf Of keishichi2001
Sent: Monday, June 19, 2006 7:17 AM
To: [email protected]
Subject: [flexcoders] how to assign itemRenderer w/ActionScript

 

I've trying following code to assign custom renderer into itemRenderer
property on a TileList.

You'll see commented part, which works well.
However, I just want to try how i can do this by ActionScript.
Following code reports no error, but each cell is empty(actually
printed 'object Object').

Someone could help me out?

k

====
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="*"
creationComplete="init()">

<mx:Script>
<![CDATA[
import itemRenderers.myThumbnail;
import mx.collections.ArrayCollection;
[Bindable]
private var photoColl:ArrayCollection;

private var mT:myThumbnail = new myThumbnail;

private function init():void
{
simpletest.send();

myTile.setStyle("itemRenderer", mT);
}
]]>
</mx:Script>

<mx:Label id="foodName"
text="Watch here"/>

<mx:HTTPService id="simpletest"
url="">photo.xml"
result="photoColl=new
ArrayCollection(simpletest.lastResult.list.food)"/>

<mx:TileList id="myTile"
dataProvider="{photoColl}"
width="700"
rowHeight="170"
columnWidth="220"/>

<!--
<mx:TileList id="foodTile"
dataProvider="{photoColl}"
itemRenderer="itemRenderers.myThumbnail"
width="700"
rowHeight="170"
columnWidth="220"/>
-->

</mx:Application>
====

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to