The ClassFactory class has a property called
'properties.' This is a hash table (object) full of key/value pairs that
get applied to instances generated by the ClassFactory as necessary. So in your
case, your markup is saying 'create a PieCategoryWedgeRenderer, and when it gets
created, assign an array of PieCategory objects to its categories property as
needed'.
So you could do this:
var cf:ClassFactory = new
ClassFactory(PieCategoryWedgeRenderer);
var tmp:Array = [];
var pc:PieCategory = new PieCategory();
pc.value = "Encouraged";
pc.color = 0x99ff99;
tmp.push(pc);
pc = new PieCategory();
pc.value = "Acceptable";
pc.color = 0x9999ff;
tmp.push(pc);
...
cf.properties = {
categories: tmp;
}
Alternatively, you could just copy the whole
PieCategoryWedgeRenderer tag and contents from your markup into a separate MXML
(call it MyPCWedgeRenderer.mxml) file to create a pre-customized subclass.
then:
var cf:ClassFactory = new
ClassFactory(MyPCWedgeRenderer);
and you're done.
Ely.
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jason Sent: Saturday, June 17, 2006 9:39 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: changing out pieSeries.itemRenderer at runtime Okay, good start. I was thrown off by the help topic"Flex 2.0
Developer's Guide > Customizing the User Interface > Using Item Renderers
and Item Editors > Creating an item renderer and item editor". It still
uses the old non-setStyle method to set the itemRenderer. -- 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
YAHOO! GROUPS LINKS
|
- RE: [flexcoders] Re: changing out pieSeries.itemRenderer a... Ely Greenfield
- Re: [flexcoders] Re: changing out pieSeries.itemRende... Pan Troglodytes
- RE: [flexcoders] Re: changing out pieSeries.itemR... Ely Greenfield
- Re: [flexcoders] Re: changing out pieSeries.i... Pan Troglodytes
- Re: [flexcoders] Re: changing out pieSeries.itemR... Pan Troglodytes