Actually, the docs just confused me more.  See the topic "Creating an item renderer and item editor".  First, the example doesn't even work as printed.  There's a typo leaving off a closing quote and flash says it doesn't know what RendererState is.  Second, it doesn't mention that this method isn't for all itemRenderers and you have to use setStyle for others.  In fact, I couldn't find a single example in the help that explained using setStyle for itemRenderers.

Jeez, you'd think this was a beta or something ;)

On 6/19/06, Michael Schmalle <[EMAIL PROTECTED] > wrote:

No,

its called J-O-K-E.

> It's just asking for confusion! :-/

Becasue there are differnet programmers and for some reason, best practices have not been set.

Also, read the docs and they clearly say if it's a style or not. As far as why, I have no idea but, the docs can guide you through this confusion.

Peace, Mike



On 6/19/06, Daniel Tuppeny < [EMAIL PROTECTED]> wrote:

It doesn't make sense to me, and I'm a programmer :-)
 
Why would ItemRenderers by styles on some objects, and not on others? It's just asking for confusion! :-/


From: [email protected] [mailto:[email protected]] On Behalf Of Michael Schmalle
Sent: 19 June 2006 16:30

To: [email protected]
Subject: Re: [flexcoders] how to assign itemRenderer w/ActionScript

>itemRenderers are sometimes styles and sometimes not.  And when they are styles, they're not really.

:)

That makes sense to a programmer... hehe

Peace, Mike

Actually I am glad this was brought up, something to figure out.

On 6/19/06, Pan Troglodytes <[EMAIL PROTECTED] > wrote:

Okay, let me correct my statement:

itemRenderers are sometimes styles and sometimes not.  And when they are styles, they're not really.

;)

On 6/19/06, Michael Schmalle <[EMAIL PROTECTED]> wrote:

Hi,

Don't get them confused;

> itemRenderers ARE styles

Theoretically it is a property not a style. You may be able to set them with setStyle() but, they are not styles of the ListBase.

Anytime you see this in a class file;

itemRenderer = new ClassFactory(ListItemRenderer);

Which is in the Constructor of List, it is a property.

and when you see this in a class

    public function get itemRenderer():IFactory
    {
        ....
    }

    /**
     *  @private
     */
    public function set itemRenderer(value:IFactory):void
    {
      ...
    }

It is a property of that class not a style.

BTW, itemRenderer is not in either of the nonInheritingStyles or inheritingStyles proto chain. So I really don't know how that is even working.

It may just be a fluke because itemRenderer is a public property already defined on the ListBase.

Just to clear some things up :)

Peace, Mike



On 6/19/06, Pan Troglodytes < [EMAIL PROTECTED]> wrote:

itemRenderers ARE styles, the help just hasn't completely been updated yet.

You were actually very close.

myTile.setStyle("itemRenderer", new ClassFactory(myThumbnail));

You may have to fully qualify it:

myTile.setStyle("itemRenderer", new ClassFactory(itemRenderers.myThumbnail));

Now, as to how to manipulate it after this, I don't know.  See my thread "changing out pieSeries.itemRenderer at runtime" where I'm asking the same thing.



On 6/19/06, keishichi2001 < [EMAIL PROTECTED]> wrote:

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="">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>
====




--
--
Jason




--
What goes up, does come down.




--
--
Jason




--
What goes up, does come down.
[Inbound Mail Scanned by MessageLabs]

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________




--
What goes up, does come down.




--
--
Jason __._,_.___

--
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