Simply put, the IDataRenderer interface.

ItemRenderers are supposed to be encapsulated, if Adobe used anything other
than the styleName of the renderer's parent, they would be breaking this
encapsulation rule.

You could try un setting the styleName in commit properties and then try
your TypeSelector again. If that dosn't work, override updateDisplayList()
and unset it after super().

Mike

On Tue, Jun 3, 2008 at 11:48 AM, Amy <[EMAIL PROTECTED]> wrote:

>   --- In [email protected] <flexcoders%40yahoogroups.com>,
> "Michael Schmalle"
> <[EMAIL PROTECTED]> wrote:
> >
> > The solution....
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Canvas
> > xmlns:mx="http://www.adobe.com/2006/mxml";
> > width="200" height="50">
> >
> > <mx:Script>
> > <![CDATA[
> >
> > override protected function commitProperties():void
> > {
> > super.commitProperties()
> >
> > if (data)
> > {
> > // uncomment to see this actually work
> > // setStyle("backgroundColor", 0xFF0000);
> >
> > // imaginary prop
> > if (data.itemColor is Number)
> > setStyle("backgroundColor", data.itemColor);
> > }
> > }
> >
> > ]]>
> > </mx:Script>
> >
> > <mx:Label x="10" y="10" text="{data.label}"/>
> >
> > </mx:Canvas>
>
> I meant a CSS solution. I could possibly create a classFactory and
> pass in the styleName in that, but that's not nearly as clean as just
> using the TypeSelector. I could also pass in a reference to the
> Application and/or its styles and have the component look at that to
> see if there is a style that matches the ClassName, but that's sort
> of icky too.
>
> Why is the List component set up to break this?
>
> Thanks;
>
> Amy
>
>  
>



-- 
Teoti Graphix, LLC
http://www.teotigraphix.com

Teoti Graphix Blog
http://www.blog.teotigraphix.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to