Item Renderer Display Optimization

I have pretty basic row item renderer displayed within a data group, it is composed of a few labels and an icon. It has a few nested layouts to display everything properly, but I would not consider it a complicated layout by any means.
Whenever I display a result set, 20 rows of data, it appears Flex is choking displaying the item renders. It takes about half a second from the moment all the item renders have been created to actually draw them on the screen and the Flex code that handles the drawing appears to be blocking because everything on the screen freezes during this half second period. This display blocking turns a very fluid display rich application into a choppy mess whenever results are displayed.
I have gone great lengths to make sure none of my code is blocking and that I always give Flash Player the room it needs to breath to maintain it's frame rate, however I am stuck with this display issue. Any suggestions would be appreciated.

Thanks for the reply Sasha. I will try an AS item renderer but I have to say that data binding and layout management are probably the two biggest reasons to use Flex in the first place. If I can't use those items and have a smooth interface I might as well go back to just writing everything using Flash. (this is a little bit irritating to say the least)
Below is the code to one of the item renderers that is casuing probelms...if anything sticks out as wrong or out of place please let me know.
I appreciate your time, and response. Thank you.
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx"
                autoDrawBackground="false"
                width="100%" height="76"
                mouseChildren="true"
                click="clickHandler(event)"
                buttonMode="true"
                useHandCursor="true" >
    <fx:Script>
        <![CDATA[
               //removed
        ]]>
    </fx:Script>
    <s:states>
        <s:State name="hovered" />
        <s:State name="normal"/>
    </s:states>
    <s:transitions>
        <s:Transition fromState="normal" toState="hovered">
            <s:Parallel>
                <s:Fade target="{backgroundRollover}" alphaFrom="0" alphaTo="1" duration="0"/>
            </s:Parallel>
        </s:Transition>
        <s:Transition fromState="hovered" toState="normal">
            <s:Parallel>
                <s:Fade target="{backgroundRollover}" alphaFrom="1" alphaTo="0" duration="0"/>
            </s:Parallel>
        </s:Transition>
    </s:transitions>
    <!-- background fill -->
    <s:Rect id="background" width="100%" height="100%" alpha="0">
        <s:fill>
             <s:SolidColor color="#FFFFFF"/>
         </s:fill>
    </s:Rect>
    <!-- background rollover fill -->
    <s:BorderContainer id="backgroundRollover" width="100%" height="76" styleName="borderContainerLight" cornerRadius="0" alpha="0" borderAlpha="0"/>
    <!-- border bottom-->   
    <controls:HDivLine bottom="0"/>
    <!-- content -->
    <s:HGroup id="row" width="100%" height="100%" gap="12" paddingLeft="12" paddingRight="12" verticalAlign="middle" horizontalAlign="center">
        <!-- place -->
        <s:Group>
            <s:layout>
                <s:VerticalLayout horizontalAlign="center"/>
            </s:layout>
            <s:Label id="position" text="{data.index}" styleName="small light" width="20" textAlign="center"/>
        </s:Group>
        <!-- box art -->
        <s:Group id="boxArtGroup" >       
            <controls:ImageLoader id="boxart" source="{data.boxArtPath}" width="64" height="64" click="btnQuickView_clickHandler(event)"/>
        </s:Group>
        <!-- title and esrb rating -->       
        <s:Group width="60%" minWidth="160">
            <s:layout><s:VerticalLayout horizontalAlign="left"/></s:layout>
            <s:Label id="title" text="{data.title}" styleName="large bold" width="100%"/>
            <s:Label text="ESRB: {data.esrbRating}" styleName="small light"/>
        </s:Group>
        <!-- platform icon -->
        <s:Group width="10%" minWidth="82">
            <s:layout>
                <s:HorizontalLayout horizontalAlign="center" />
            </s:layout>
            <s:BitmapImage source="{PlatformIcons.getIcon(data.platform)}"/>
        </s:Group>
        <!-- release date -->
        <s:Group width="20%" minWidth="74">
            <s:layout><s:VerticalLayout horizontalAlign="center"/></s:layout>
            <s:Label text="{data.releaseDate}" styleName="bold"/>
            <s:Label text="release date" styleName="small light"/>
        </s:Group>
        <!-- rating average -->
        <s:Group width="10%" minWidth="74">
            <s:layout><s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/></s:layout>
            <controls:RatingBoxSmall width="48" height="48" ratingType="RATING" ratingNumber="{data.memberRating}"/>
        </s:Group>
    </s:HGroup>
</s:ItemRenderer>

Similar Messages

  • Datagrid Item Renderer not displaying correct data

    I have a datagrid that displays information from a web service, which is refreshed every 60 seconds.
    When the status is no 0 for a line a corresponding color is used to fill in the background.  I created a Item Renderer to fill in the background color.
    When the table is initially created, the colors are correct.  After the data is refreshed, then the background color value is carried over to the next row.
    The Spark DataGrid works better than the MX AdvancedDateGrid or DataGrid.  This was working in Flex 3, but I used an function which replaced the DataGridColumn that doesn't work in Flex 4.
    protected function init(event:FlexEvent):void
                    var showBackground:Boolean = false;
                    var backgroundColor:uint = new uint();
                    var labelTextColor:uint = new uint();
                    var dgListData:DataGridListData = listData as DataGridListData;
                    var dataGrid:DataGrid = dgListData.owner as DataGrid;
                    // comment this out if you want to see the background over the
                    // selection and highlight indicators
                    if (dataGrid.isItemSelected(data) || dataGrid.isItemHighlighted(data))
                        // clear the background so you can see the selection/highlight colors
                        showBackground = false;
                        return;
                    switch(data["MessageLevel"])
                        case 0:
                            showBackground = false;
                            backgroundColor = 0xFFFFFF;
                            labelTextColor = 0x000000;
                            break;
                        case 1:
                            showBackground = true;
                            backgroundColor = 0x00FF00;  // light green
                            labelTextColor = 0x000000;
                            break;
                        case 2:
                            showBackground = true;
                            backgroundColor = 0x015F00; // dark green
                            labelTextColor = 0xFFFFFF;
                            break;
                        case 3:
                            showBackground = true;
                            backgroundColor = 0xFDFF00; // yellow
                            labelTextColor = 0x000000;
                            break;
                        case 4:
                            showBackground = true;
                            backgroundColor = 0x7F6E3F; // tan
                            labelTextColor = 0xFFFFFF;
                            break;
                        case 5:
                            showBackground = true;
                            backgroundColor = 0xFF8A00; // orange;
                            labelTextColor = 0x000000;
                            break;
                        case 6:
                            showBackground = true;
                            backgroundColor = 0xFFDFE0; // rose
                            labelTextColor = 0x000000;
                            break;
                        case 7:
                            showBackground = true;
                            backgroundColor = 0xFF0000; //red
                            labelTextColor = 0xFFFFFF;
                            break;   
                    if(showBackground) {
                        var bgFill:SolidColor = new SolidColor();
                        bgFill.color = backgroundColor;
                        dataContainer.setStyle("backgroundColor",backgroundColor);
                        lblData.setStyle("color", labelTextColor);

    I added an "else" statement to make sure that a color was always added, even if the level was 0.  I also added a backgroundAlpha style to both, to turn the value off or on.
    So far, this seems to be the solution.
    if(showBackground) {
    var bgFill:SolidColor = new SolidColor();
    bgFill.color = backgroundColor;
    dataContainer.setStyle("backgroundColor",backgroundColor);
    labelDisplay.setStyle("color", labelTextColor);
    dataContainer.setStyle("backgroundAlpha",1);
    } else {
    dataContainer.setStyle("backgroundColor",backgroundColor);
    labelDisplay.setStyle("color", labelTextColor);
    dataContainer.setStyle("backgroundAlpha",0);

  • Need for a Datagrid with variableRowHeight="true" and custom Item Renderer to display exact rows

    Hi again, developers:
    I'm in a search of a datagrid  with certain characteristics:
         - variableRowHeight = "true"
         - only one column
         - each row must have a custom item renderer with possibly different heights, and a fixed width
         - the datagrid must show always every item in the data provider with no vertical scroll bars, what means that the datagrid height must have always the exact height sum of all the item renderers it is displaying.
         - and no extra empty rows must appear in the last positions of the datagrid
    The last two requirements are something difficult to achieve... for some reason, empty rows appear at the last positions of the datagrid. I post what i've managed to get:
    <mx:Script>
         <![CDATA[
         private function resize():void
                    if (dg.dataProvider)
                        var h:Number = dg.measureHeightOfItems( -1, dg.dataProvider.length);
                        dg.height = h;
         ]]>
    </mx:Script>
    <mx:DataGrid id="dg" width="530" horizontalCenter="0" verticalScrollPolicy="off"
            dataProvider="{dp}"
            wordWrap="true" variableRowHeight="true" showHeaders="false" dataChange="resize()" height="{dg.measureHeightOfItems(-1,dg.dataProvider.length)}" click="Alert.show(dg.rowCount.toString());">
            <mx:columns>
                <mx:DataGridColumn headerText="ID" width="50">
                    <mx:itemRenderer>
                        <mx:Component>
                            <mx:TextArea height="{Math.random()*100}" wordWrap="true" backgroundColor="{Math.random() * 16777216}" paddingTop="0" paddingBottom="0"/>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
            </mx:columns>
        </mx:DataGrid>

    Thanks Harui, but it doesn't help. If the border is set it will help, but the very big problem is the empty rows that appear at the end of the datagrid... I can't find a way of measuring correctly the height of the itemRenderers!
    I'll update this thread if I manage to do it.

  • Flex SDK 3.4 Tree Item Renderer Root Folder displays Tooltip for Child

    I have a Flex Tree that uses a custom item renderer.  The item renderer extends Tree Item Renderer and I add my button in commit properties (since the data is dynamic) and I use update displaylist to move it to the right position.  I set the button to be visible on rollover and make the icon invisible. On rollout I reverse that logic.
    When I have my item renderer add the button, it causes only one problem and it seems to be under certain conditions:
    - Single root folder for the tree
    - Upon opening the tree, the root folder displays the tool tip for the last child in the tree
    Any idea why the tooltip comes up?
    public function AssetTreeItemRenderer ()
                super();
                addEventListener(MouseEvent.ROLL_OVER, onItemRollover);
                addEventListener(MouseEvent.ROLL_OUT, onItemRollout);
                addEventListener(ToolTipEvent.TOOL_TIP_SHOWN, toolTipShown);
                addEventListener(ToolTipEvent.TOOL_TIP_CREATE, onCreateToolTip);
            // OVERRIDEN FUNCTIONS
             * override createChildren
            override protected function commitProperties():void {
                super.commitProperties();
                if(data is IAsset) {
                    if(playBtn === null) {
                        playBtn = new Button();
                        playBtn.styleName = "previewPlayButton";
                        playBtn.toolTip = "Play";
                        playBtn.width = icon.width + 2;
                        playBtn.height = icon.height + 2;
                        playBtn.visible = false;
                        playBtn.addEventListener(MouseEvent.CLICK, onPlayBtnClick);
                        addChild(playBtn);
                } else {
                    if(playBtn !== null) {
                        removeChild(playBtn);
                        playBtn = null;
             * override updateDisplayList
             * @param Number unscaledWidth
             * @param Number unscaledHeight
            override protected function updateDisplayList(unscaledWidth:Number,
                                                          unscaledHeight:Number):void
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                //Move our play button to the correct place
                if(super.data && playBtn !== null)
                    playBtn.x = icon.x;
                    playBtn.y = icon.y;

    You are not clearing tooltip if data is not IAsset

  • Display item renderer in only some rows of a datagrid

    I need to display a combobox item renderer in my datagrid
    only in the first of every 5 rows. With the remaining 4 rows in
    this particular column empty. Then the pattern will repeat again.
    This is how I am currently creating the columns however with
    this approach the combobox itemrenderer is appearing in all rows
    <mx:columns>
    <mx:DataGridColumn headerText="No."
    dataField="assCriteriaNum" width="60" />
    <mx:DataGridColumn headerText="Assessment Criteria"
    dataField="assCriteria" width="210"/>
    <mx:DataGridColumn headerText="Mark Range"
    dataField="markRange" width="50" />
    <mx:DataGridColumn headerText="Mark" dataField="mark"
    width="70" >
    <mx:itemRenderer>
    <mx:Component>
    <mx:ComboBox>
    <mx:dataProvider>
    <mx:ArrayCollection>
    <mx:String>0</mx:String>
    <mx:String>1</mx:String>
    <mx:String>2</mx:String>
    <mx:String>3</mx:String>
    <mx:String>4</mx:String>
    <mx:String>5</mx:String>
    <mx:String>6</mx:String>
    <mx:String>7</mx:String>
    <mx:String>8</mx:String>
    <mx:String>9</mx:String>
    <mx:String>10</mx:String>
    </mx:ArrayCollection>
    </mx:dataProvider>
    </mx:ComboBox>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    </mx:columns>

    Here is my data provider hard coded
    <mx:dataProvider>
    <mx:ArrayCollection>
    <mx:Array>
    <mx:Object assCriteria="A01 Manage." />
    <mx:Object assCriteriaNum="1" assCriteria="Brief project
    plan, with little evidence of monitoring progress of project work
    against the project plan." markRange="(1-3)" />
    <mx:Object assCriteriaNum="2" assCriteria="Limited
    identification of the topic to be investigated/ researched and
    limited evidence of appropriate aims and objectives, and proposed
    project title." markRange="(1-3)" />
    <mx:Object assCriteriaNum="3" assCriteria="Project plan,
    with some evidence of monitoring progress of project work against
    the project plan." markRange="(4-6)" />
    <mx:Object assCriteriaNum="4" assCriteria="Some
    identification of the topic to be investigated/ researched and some
    evidence of appropriate aims complete the work and objectives, and
    proposed project title." markRange="(4-6)" />
    <mx:Object assCriteriaNum="5" assCriteria="Detailed
    project plan, with clear evidence of monitoring progress of project
    work against the project plan." markRange="(7-10)" />
    <mx:Object assCriteriaNum="6" assCriteria="Clear
    identification of the topic to be investigated/ researched and
    clear evidence of appropriate aims identify the topic and
    objectives, and proposed project title." markRange="(7-10)" />
    <mx:Object assCriteriaNum="7" assCriteria="No relevant
    response." markRange="(0)" />
    <mx:Object assCriteria="A02 Use resources/research."
    />
    <mx:Object assCriteriaNum="8" assCriteria="Little or no
    analysis and application of the research, with few links made to
    appropriate theories and concepts." markRange="(1-5)" />
    <mx:Object assCriteriaNum="9" assCriteria="Evidence of
    limited research involving limited selection and evaluation of
    sources." markRange="(1-5)" />
    <mx:Object assCriteriaNum="10" assCriteria="Some analysis
    and application of the research, with links made to appropriate
    theories and concepts." markRange="(4-6)" />
    <mx:Object assCriteriaNum="11" assCriteria="Evidence of
    some research involving the selection analyse data and evaluation
    of a range of relevant sources." markRange="(4-6)" />
    <mx:Object assCriteriaNum="12" assCriteria="Critical
    analysis and application of the research, with obtain and select
    clear links made to appropriate theories and information from a
    concepts. variety of sources." markRange="(7-10)" />
    <mx:Object assCriteriaNum="13" assCriteria="Evidence of
    detailed research involving the selection and evaluation of a wide
    range of relevant sources." markRange="(7-10)" />
    <mx:Object assCriteriaNum="14" assCriteria="No relevant
    response." markRange="(0)" />
    </mx:Array>
    </mx:ArrayCollection>
    </mx:dataProvider>

  • Using a bitmap object as a item renderer in a datagrid

    I have a UIComponent grabbed has a bitmap, and stored in an
    array collection.
    I want to display a thumbnail in a datagrid, I can make a
    itemRenderer for an image with a local or remote file as a source.
    But how do I use the bitmap in the array collection in an item
    renderer.
    Thanks
    Dean

    Here is an example with a HorizontalList:
    <?xml version="1.0" ?>
    <!-- itemRenderers\htlist\myComponents\Thumbnail.mxml
    -->
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    horizontalAlign="center"
    verticalGap="0" borderStyle="none" backgroundColor="white"
    >
    <mx:Image id="image" width="60" height="60"
    source="{data.image}"/>
    <mx:Label text="{data.name}" width="120"
    textAlign="center"/>
    <mx:Label text="${data.price}" fontWeight="bold"/>
    </mx:VBox>
    <?xml version="1.0"?>
    <!-- itemRenderers\htlistMainlistThumbnailRenderer.mxml
    -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Model id="catalog" source="catalog.xml"/>
    <mx:HorizontalList id="myList"
    columnWidth="125"
    rowHeight="125"
    columnCount="4"
    dataProvider="{catalog.product}"
    itemRenderer="myComponents.Thumbnail"/>
    <mx:LinkButton label="Product images courtesy of Lavish"
    click="navigateToURL(new URLRequest('
    http://www.shoplavish.com'),
    '_blank')"/>
    </mx:Application>
    <?xml version="1.0"?>
    <catalog>
    <product id="1">
    <name>USB Watch</name>
    <price>129.99</price>
    <image>assets/products/usbwatch.jpg</image>
    <thumbnail>assets/products/usbwatch_sm.jpg</thumbnail>
    </product>
    <product id="2">
    <name>007 Digital Camera</name>
    <price>99.99</price>
    <image>assets/products/007camera.jpg</image>
    <thumbnail>assets/products/007camera_sm.jpg</thumbnail>
    </product>
    <product id="3">
    <name>2-Way Radio Watch</name>
    <price>49.99</price>
    <image>assets/products/radiowatch.jpg</image>
    <thumbnail>assets/products/radiowatch_sm.jpg</thumbnail>
    </product>
    <product id="4">
    <name>USB Desk Fan</name>
    <price>19.99</price>
    <image>assets/products/usbfan.jpg</image>
    <thumbnail>assets/products/usbfan_sm.jpg</thumbnail>
    </product>
    <product id="5">
    <name>Caffeinated Soap</name>
    <price>19.99</price>
    <image>assets/products/soap.jpg</image>
    <thumbnail>assets/products/soap_sm.jpg</thumbnail>
    </product>
    <product id="6">
    <name>Desktop Rovers</name>
    <price>49.99</price>
    <image>assets/products/rover.jpg</image>
    <thumbnail>assets/products/rover_sm.jpg</thumbnail>
    </product>
    </catalog>

  • Data provider problem in custom item renderer

    I have a complex, custom item renderer for a list. I add
    items that I extracted from an xml to the data provider using the
    IList interface. But when displaying the list, the items are all
    screwed up. Each rendered item has some parts which are initialized
    as different components depending on the values from the xml. This
    initialization is called in the item renderer for the
    creationComplete event.
    The weird thing is that when I output the dataProvider to
    check its values, some of the items have internal uids sometimes
    and sometimes they don't. If I output the dataProvider right after
    I add the items to it, none of them get internal uids. But from the
    initialize method, some of them do and some don't.
    To make things weirder, sometimes, as I scroll up and down
    the list, the dynamic components get all switched up. I'm either
    having a problem with internal uids or with the creation policies
    for lists. Or it's probably some simpler mistake I have yet to see.
    Anyone have any idea where the problem could lie? Any help is
    greatly appreciated.

    Any successful render must:
    1) override the set data property of the component
    Further, best practice is to store any data you need in the
    override set data(), and call invalidateProperties(). Then do the
    actual work in an override commitProperties() function.
    The framework is smart about when to call commitProperties
    efficiently. set data() gets called much more often.
    Tracy

  • Page item rendering location relative to report?  (APEX 2.2.0)

    Hi all,
    What controls where the page items in a region containing a report will be rendered? I have two regions that (I thought) I set up identically, but one has the items above the report and the other below.
    The only difference between them is that the one with the items above is on a non-zero page, whereas the one with the items below is on page zero.
    (I cannot post my app to a public area as an example.)
    Am I missing something?
    Thanks!
    Don

    Hi all,
    I apologize if I was vague or confusing. It's been a long Friday and it is continuing to be a long Friday = ) Louis-Guillaume, I tried changing one of the regions, and something very odd happened! So here's exactly what I do:
    I create a region in page 0, "My Page Zero Region". It is an SQL report region. I then add "Item One" and "Item Two" to that region. The items are in the same region as the report table. I put it at the "Page Template Body (3)" display point. I then get this:
    My Page Zero Region
    Item One : [             ] (this is an item.)
    Item Two : [             ] (this is an item.)
    |            |  the table |         |
    |            |            |         |
    |            |            |         |
    ---------------------------------The items are displayed above the table. I then switch the display point to "Page Template Body (2)". The region is then rendered differently.
    My Page Zero Region
    |            |  the table |         |
    |            |            |         |
    |            |            |         |
    Item One : [             ] (this is an item.)
    Item Two : [             ] (this is an item.)It seems that APEX treats the entire region differently depending on which display point it is in. Is that the correct functionality, or should I investigate further?

  • Dynamic Item Renderer

    Hello everyone,
    I used Catalyst to design my interaction and navigation and then use Flash Builder to add all my logic. Everything works as expected but i have one issue regarding my item renderer data list.
    Here is my issue : i set up an itemRenderer for a dynamic calendar filled by a database.
    Every schedule contain one to four workshops (data.ws, data.ws2. data.ws3 data.ws4) and are separated by a static bar (footerGroup)
    So, i am trying (since days now) to make this separate bar dynamic so there are no blank gap between repeated two schedules if there are less than 4 workshops.
    I reckon i need to code an actionscript "if statement" for the bar to move its Y according to workshops.
    Thanks for your help and guidance guys,
    i have a designer background and have some hard time to develop some special features
    End-user view without the dynamic bar:
    here's my Flash Builder code :
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:d="http://ns.adobe.com/fxg/2008/dt"
                        xmlns:flm="http://ns.adobe.com/flame/2008"
                        autoDrawBackground="false"
                        xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script>
         <![CDATA[
         ]]>
    </fx:Script>         
         <s:states>
              <s:State name="normal"/>
         </s:states>
         <s:RichText id="time"
                        x="5" y="20"
                        color="#2B4381" fontFamily="Arial" fontSize="20" tabStops="S0 S50 S100 S150"
                        text="{data.time}"/>
         <s:RichText id="subject"
                        x="160" y="20"
                        color="#2B4381" fontFamily="Arial" fontSize="20" tabStops="S0 S50 S100 S150"
                        text="{data.subject}"/>
         <s:RichText id="workshop"
                        x="5" y="60"
                        color="#000000" fontFamily="Arial" fontSize="20" fontWeight="bold" tabStops="S0 S50 S100 S150"
                        text="{data.ws}"/>
         <s:RichText id="workshop2"
                        x="5" y="100"
                        color="#2B4381" fontFamily="Arial" fontSize="20" tabStops="S0 S50 S100 S150"
                        text="{data.ws2}"/>
         <s:RichText id="workshop3"
                        x="5" y="140"
                        color="#2B4381" fontFamily="Arial" fontSize="20" tabStops="S0 S50 S100 S150"
                        text="{data.ws3}"/>
         <s:RichText id="workshop4"
                        x="5" y="180"
                        color="#2B4381" fontFamily="Arial" fontSize="20" tabStops="S0 S50 S100 S150"
                        text="{data.ws4}"/>
         <s:Group flm:knockout="false" rotation="90" x="520" y="232.3"
                    id="footerGroup">
              <s:Path data="M 0.199 0.952 C 0.119 -0.504 -0.109 1.737 0.062 0 C 0.205 0.196 0.311 0.479 0.199 0.952 Z" height="1.124" width="0.246" winding="nonZero" x="3.022" y="0">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 3.021 388.311 C 2.105 383.619 3.03 377.439 2.447 372.301 C 2.408 371.697 2.948 372.455 2.828 371.098 C 2.116 366.115 2.541 358.266 3.089 352.197 L 3.23 352.565 C 3.333 351.41 2.864 349.998 2.929 348.773 C 3.023 348.765 3.063 349.166 3.193 348.883 C 2.908 348.575 3.06 346.668 2.849 346.149 C 2.96 345.666 3.185 345.712 3.31 345.087 L 2.987 344.386 C 2.22 342.438 3.04 339.652 2.643 336.992 C 2.719 337.121 2.777 337.386 2.849 337.174 C 2.384 332.905 2.471 327.563 2.299 322.79 C 2.413 322.98 2.62 323.155 2.749 322.877 C 2.409 322.641 2.324 321.167 2.257 319.888 C 2.606 319.312 1.938 317.694 2.132 316.192 L 2.208 316.321 C 1.842 315.213 2.419 314.677 1.98 313.777 L 2.255 313.072 C 1.762 312.587 2.51 311.468 2.26 310.552 L 2.158 310.581 C 2.039 309.718 2.286 309.268 2.203 308.466 L 2.26 308.39 C 2.132 306.513 2.404 305.421 2.02 305.468 C 2.328 304.809 2.161 307.288 2.609 306.253 C 2.213 300.08 2.291 293.713 2.283 287.497 C 2.437 286.792 2.484 286.342 2.631 286.184 C 2.553 285.563 2.559 283.845 2.362 283.281 C 2.371 283.49 2.559 282.88 2.578 282.551 C 2.723 281.421 2.156 281.315 2.328 280.074 C 2.43 280.568 2.554 280.736 2.697 280.57 C 2.397 279.513 2.445 278.096 2.348 276.844 C 2.413 277.038 2.451 277.34 2.572 277.293 C 2.232 275.923 2.643 274.796 2.429 273.597 L 2.65 274.044 C 2.92 272.112 2.186 273.475 2.345 271.804 C 2.416 272.205 2.503 272.063 2.594 272.136 C 2.19 270.577 2.324 268.057 2.186 266.503 C 2.217 266.596 2.278 266.57 2.278 266.57 C 2.227 264.877 2.353 263.105 2.178 261.244 C 2.275 260.566 2.719 261.466 2.637 259.673 C 2.191 259.738 2.454 256.631 1.95 257.687 C 2.022 256.155 2.19 253.732 2.039 252.712 C 2.208 253.4 2.583 251.967 2.62 253.24 L 2.89 252.277 C 3.072 252.421 2.829 253.268 3.058 252.962 C 3.04 252.324 2.864 250.466 2.936 249.896 C 2.664 248.714 2.154 247.629 2.097 245.716 C 2.271 246.615 2.589 245.205 2.665 245.814 L 1.812 243.146 C 1.792 242.511 2.163 243.009 2.047 242.089 C 1.929 242.135 1.856 241.734 1.76 241.455 C 1.812 241.215 1.65 238.808 2.09 238.531 C 2.26 238.248 2.179 239.567 2.337 238.862 C 2.333 237.688 2.181 237.636 2.175 236.46 L 2.233 236.437 C 2.299 235.662 2.047 234.15 1.804 234.993 C 1.792 235.533 2.068 234.788 1.94 235.588 C 1.686 235.041 1.615 233.676 1.611 232.499 C 1.68 232.9 1.798 232.852 1.922 233.013 C 1.577 231.434 1.469 229.759 1.324 227.994 C 1.115 227.967 1.704 228.652 1.594 228.912 C 1.883 226.651 1.183 224.242 1.606 222.361 C 1.642 222.67 1.31 222.526 1.369 222.505 C 1.394 221.415 1.697 221.466 1.586 220.757 C 1.762 220.685 1.528 219.863 1.474 219.133 C 1.346 218.755 1.56 218.943 1.58 219.579 C 1.43 218.562 1.158 214.486 1.416 212.135 C 1.299 212.181 0.985 210.69 0.998 210.15 L 1.272 210.361 C 1.436 209.867 1.249 208.55 1.483 208.459 C 1.15 207.304 1.767 212.907 1.511 211.345 C 1.739 210.939 1.073 209.168 1.447 209.504 C 1.436 208.419 1.129 207.365 1.385 206.328 C 1.341 206.628 1.765 207.209 1.746 206.333 C 1.697 204.787 1.615 205.894 1.523 204.64 L 1.411 203.854 C 1.143 203.804 1.447 202.474 1.148 203.048 C 1.369 202.857 1.012 200.804 1.455 200.962 L 1.804 201.177 C 1.779 200.51 1.436 200.084 1.283 199.56 C 1.314 199.472 1.385 199.296 1.441 199.33 C 0.907 199.223 1.486 197.736 1.073 196.942 C 1.259 195.542 1.091 193.385 1.423 192.724 C 1.261 191.647 1.07 190.665 1.183 189.438 C 1.234 189.684 1.249 190.018 1.364 190.087 C 1.521 189.316 1.381 189.126 1.294 188.421 C 1.373 188.579 1.606 186.88 1.795 186.022 C 1.636 184.954 1.347 185.322 1.172 185.214 C 1.699 184.236 0.832 182.193 1.31 180.969 C 1.383 181.34 1.569 182.531 1.701 181.64 C 2.227 180.662 1.313 179.668 1.565 178.093 L 1.129 178.479 C 1.399 177.776 0.874 176.159 1.319 176.319 C 1.162 175.792 1.465 174.46 1.038 174.635 C 1.399 172.047 0.82 168.337 1.586 166.747 C 1.513 166.376 1.587 165.449 1.367 165.639 C 1.13 166.255 1.537 166.5 1.376 166.73 C 1.363 166.396 1.246 166.325 1.187 166.289 C 1.284 165.484 1.314 164.852 1.67 165.611 C 1.933 163.821 0.944 163.764 1.112 161.484 C 1.288 161.587 1.354 161.414 1.326 160.747 L 1.024 159.482 C 1.095 158.009 1.426 158.645 1.724 158.608 C 1.674 157.821 1.687 156.858 1.465 156.499 L 1.84 155.543 C 1.569 156.242 1.659 154.895 1.587 154.525 L 1.659 154.895 C 1.787 154.751 1.709 153.839 1.671 153.377 C 1.486 153.488 1.411 154.418 1.357 154.925 C 1.225 154.523 1.256 153.896 1.101 153.362 C 1.394 153.539 1.31 152.078 1.341 151.453 C 1.404 150.735 1.078 150.643 1.088 150.434 C 1.24 150.415 1.113 149.262 1.326 149.821 C 1.376 150.066 1.179 150.381 1.313 150.786 C 1.426 150.313 1.691 150.368 1.498 149.385 C 1.352 148.646 0.919 149.574 1.103 148.173 C 1.177 148.54 1.294 148.607 1.399 148.895 L 1.552 147.579 L 1.284 147.522 C 1.352 147.345 1.376 147.468 1.411 147.388 C 1.13 146.994 1.324 145.38 1.008 145.082 C 0.979 144.419 1.193 143.685 1.223 143.051 L 1.247 143.173 C 1.404 142.398 1.301 141.37 1.12 140.72 L 1.179 140.754 C 1.2 140.331 1.158 139.333 1.001 138.801 C 1.202 137.734 2.01 138.444 1.674 137.262 C 1.664 136.179 1.183 135.564 1.012 135.999 C 1.193 134.053 0.757 131.84 1.172 130.035 C 1.064 129.754 0.996 129.932 0.932 129.354 C 1.038 126.494 0.616 123.315 1.141 121.039 C 1.254 121.867 1.41 121.094 1.56 121.077 C 1.322 120.393 1.809 120.254 1.399 120.009 C 1.158 120.076 1.041 120.009 0.943 120.813 C 0.813 119.107 0.813 116.513 1.038 115.566 C 0.927 116.04 0.853 115.672 0.78 115.301 C 1.166 115.423 1.223 114.165 1.088 113.213 L 0.853 113.08 L 1.095 112.459 C 1.019 112.094 0.602 112.056 0.827 111.112 C 0.919 111.062 1.012 111.007 1.078 110.833 C 0.886 109.85 0.56 108.46 0.76 107.393 L 1.101 106.518 C 1.064 106.062 0.857 105.291 0.76 106.096 C 0.966 104.271 0.991 103.098 1.288 102.52 C 0.566 99.378 0.537 94.817 0.588 91.165 L 0.763 91.275 C 0.928 90.293 0.457 90.764 0.579 90.08 C 0.746 90.397 0.943 89.333 1.148 90.104 C 1.334 88.699 0.844 88.294 0.763 87.382 C 0.533 87.242 0.912 88.116 0.619 87.94 C 0.537 87.783 0.799 85.997 0.45 85.779 C 0.587 85.427 0.844 85.701 0.985 85.892 L 0.815 85.034 C 1.223 83.985 1.545 87.424 2.047 86.322 L 1.993 85.532 C 2.357 84.776 2.404 87.622 2.53 85.638 C 2.357 84.776 1.851 84.042 1.697 84.809 C 1.6 83.016 0.865 83.979 0.894 82.051 C 1.099 81.525 0.943 83.595 1.23 83.223 C 1.512 82.315 1.073 81.402 1.172 80.594 C 1.041 81.491 0.687 80.733 0.623 80.153 C 0.789 79.174 0.954 80.791 0.99 79.401 C 0.789 79.174 0.637 77.897 0.497 79 C 0.04 78.498 0.623 77.557 0.269 76.801 C 0.592 76.349 1.012 78.23 1.173 76.703 C 0.863 76.946 0.752 74.822 0.294 75.629 C 0.382 75.031 0.626 74.968 0.815 75.402 C 1.007 74.55 0.251 73.332 0.865 73.051 L 0.549 72.758 C 0.651 72.489 0.73 72.107 0.9 71.67 C 0.906 70.919 0.47 69.246 0.949 69.314 C 0.9 69.073 0.921 67.355 0.592 68.018 C 0.39 69.086 0.832 69.246 0.386 69.842 C 0.75 69.086 0.338 68.301 0.216 67.684 L 0.4 67.583 C 0.328 67.216 0.369 66.369 0.169 66.139 C 0.274 66.422 0.4 66.273 0.445 65.982 L 0.164 65.596 C 0.023 64.104 0.658 65.243 0.576 63.791 L 0.795 64.896 C 0.748 64.652 1.012 64.158 0.924 63.462 C 0.667 63.191 0.358 62.685 0.159 62.452 C 0.047 61.633 0.449 62.085 0.185 61.278 L 0.494 62.334 C 0.579 62.495 0.919 61.623 0.912 60.529 C 0.822 59.83 0.452 58.745 0.311 59.848 C 0.306 59.298 0.464 58.529 0.651 58.965 C 0.562 57.721 0.375 59.129 0.216 58.057 C 0.387 57.618 0.631 56.25 0.879 55.426 L 1.308 56.545 L 1.313 55.802 C 1.657 56.765 1.575 55.313 1.938 55.857 C 1.994 55.348 1.871 54.731 1.776 54.24 C 1.195 55.729 0.982 52.574 0.452 53.007 C 0.306 50.968 1.741 51.731 0.912 49.606 C 0.773 49.954 0.37 48.953 0.523 50.237 C 0.581 48.97 -0.008 49.375 0.211 47.881 C 0.429 48.987 0.748 46.692 1.064 48.29 C 0.889 48.185 0.931 49.184 0.979 49.429 C 1.183 48.907 1.513 49.536 1.513 48.239 C 1.464 47.448 1.453 46.362 1.177 46.522 C 0.873 46.553 1.209 47.729 0.902 47.222 C 0.797 45.645 1.259 45.381 0.72 44.729 C 0.762 45.726 0.45 45.975 0.241 45.955 L 0.115 44.799 L 0.316 45.023 C 0.462 43.164 -0.049 44.474 0.005 42.675 L 0.403 41.83 C 0.746 42.259 0.251 44.448 0.809 44.127 C 0.832 42.957 0.549 42.569 0.692 41.467 L 0.804 42.29 C 0.822 41.87 1.563 41.454 1.13 39.786 C 0.961 38.925 0.931 39.559 0.721 39.537 C 0.658 37.658 0.445 37.097 0.412 35.887 C 0.82 36.136 0.452 33.748 0.869 35.085 C 0.631 35.699 0.654 38.416 1.043 39.081 C 1.527 38.397 0.974 40.557 1.465 40.958 C 1.476 39.453 1.952 39.526 2.263 39.284 C 2.286 38.866 2.154 38.46 2.105 38.211 C 1.812 38.034 1.816 38.581 1.513 38.612 C 1.594 36.932 1.43 35.313 1.143 34.386 C 1.289 33.824 1.582 34.002 1.611 34.667 C 1.523 32.667 1.563 30.531 1.652 28.63 C 1.173 29.859 1.54 26.513 1.141 27.351 C 1.033 28.369 0.692 29.243 0.478 28.681 C 0.509 28.046 0.687 28.702 0.79 28.437 C 0.528 27.626 1.209 27.178 0.797 26.382 C 0.951 28.209 1.381 26.737 1.756 27.072 C 1.545 25.755 2.022 27.129 2.022 25.825 C 1.814 24.514 1.65 22.9 1.569 21.442 C 1.924 19.609 1.575 16.799 1.56 15.163 C 1.751 14.306 2.175 14.886 2.249 13.958 C 2.24 12.866 1.792 14.766 1.985 13.151 L 2.069 13.307 C 1.972 12.817 2.357 10.345 1.748 9.868 L 2.208 10.366 C 2.25 10.065 2.144 9.786 2.095 9.537 C 2.245 9.524 2.381 9.173 2.479 9.663 C 2.796 8.667 2.429 7.571 2.416 6.488 L 2.144 7.185 C 1.931 5.331 2.201 4.09 2.105 2.295 L 2.372 2.35 L 2.213 1.282 C 2.471 1.543 2.637 0.564 2.421 0 L 3.072 2.774 C 2.916 3.545 2.752 1.932 2.489 2.416 C 2.26 2.827 2.333 4.486 2.589 4.754 C 2.618 4.119 2.559 4.09 2.463 3.596 C 2.834 3.387 2.819 4.352 3.066 4.829 C 3.052 4.495 3.164 4.022 3.047 3.95 C 3.227 4.604 3.256 5.264 3.264 6.353 C 3.119 5.616 3.035 6.754 2.929 6.475 C 3.256 6.562 3.356 7.603 3.264 8.95 C 2.887 9.91 3.508 11.477 3.403 13.037 C 3.072 12.404 2.807 11.595 2.674 10.647 C 2.509 11.627 2.683 11.736 2.517 12.718 C 2.763 13.193 3.14 13.531 3.291 14.808 L 3.047 14.878 C 3.172 16.035 3.533 16.035 3.464 17.509 C 3.345 20.034 3.345 22.632 3.314 24.56 L 3.071 24.632 C 3.592 25.705 3.263 28.204 3.494 29.648 C 3.26 32.104 3.726 34.981 3.306 36.239 C 3.494 40.574 3.678 44.363 3.588 48.852 L 3.234 48.096 C 3.494 48.9 3.03 48.62 3.083 49.409 C 3.365 48.501 3.45 50.503 3.667 51.059 C 3.391 53.058 3.692 55.625 3.939 57.397 L 3.696 57.466 C 4.153 59.256 3.752 61.395 3.678 63.626 C 3.576 63.882 3.347 64.285 3.375 64.95 C 3.768 66.16 3.74 66.793 3.986 68.568 C 3.986 69.865 3.889 71.97 3.736 73.287 C 4.289 78.164 3.935 83.145 4.267 88.214 L 3.982 88.579 C 4.594 93.494 4.038 99.538 4.352 103.733 L 3.863 103.328 C 3.714 104.644 3.991 106.326 4.338 105.99 C 4.188 107.31 4.575 109.281 4.173 110.12 C 4.083 111.467 4.399 111.769 4.465 112.89 C 4.279 115.588 4.322 116.589 4.413 119.133 L 4.443 118.501 C 4.336 118.223 4.129 118.197 4.096 118.831 C 4.234 119.781 3.966 122.322 4.549 121.377 C 4.213 124.092 4.823 127.711 4.369 130.354 C 4.528 130.13 4.558 130.797 4.666 131.076 C 4.674 133.459 4.347 135.966 4.619 137.865 C 4.54 138.243 4.347 137.262 4.331 138.233 C 4.393 138.808 4.54 138.243 4.629 138.953 C 4.927 142.814 4.322 146.771 4.399 150.279 C 4.707 156.521 4.552 163.031 4.603 169.011 L 4.486 168.943 C 4.933 170.944 4.027 173.641 4.701 175.238 C 4.59 175.712 4.648 177.046 4.423 176.695 C 4.739 178.289 4.125 181.158 4.527 183.464 C 4.537 183.253 4.513 183.131 4.464 182.886 C 4.205 185.214 4.558 187.269 4.324 189.726 C 4.273 189.477 4.237 189.022 4.12 188.949 C 3.895 189.899 4.615 191.199 4.05 191.719 C 4.054 192.264 4.334 192.107 4.317 191.773 C 4.096 197.153 4.458 202.896 4.587 208.495 C 4.249 212.506 3.635 208.739 4.056 211.904 C 3.948 212.164 4.272 212.092 4.155 212.135 C 4.313 213.359 3.525 214.043 3.82 214.892 C 4.167 214.541 4.014 215.458 4.225 215.482 C 4.001 217.937 3.687 218.428 3.951 220.364 L 3.768 220.219 C 4.284 222.488 4.008 225.118 4.603 227.033 C 4.712 239.549 5.041 251.545 5.11 263.748 C 4.997 275.81 5.263 287.619 4.947 299.869 C 4.469 302.738 4.481 302.953 4.676 306.105 C 4.598 305.977 4.58 305.78 4.507 305.991 C 4.9 306.147 4.545 308.21 4.92 308.51 C 4.846 313.039 4.955 317.21 4.957 321.87 C 4.915 321.133 4.594 320.764 4.619 321.64 L 4.871 322.554 L 4.76 322.704 C 4.818 323.304 5.013 323.956 5.139 323.337 C 5.479 335.042 4.691 346.557 4.787 358.021 C 4.623 360.742 4.773 364.616 4.853 367.576 C 4.33 376.342 3.906 384.244 4.272 393.151 C 4.272 393.151 3.256 391.988 3.021 388.311 Z" height="464.274" width="5.229" winding="nonZero" x="0" y="4.637" id="footer">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.565 0.015 C 0.369 0.328 0.261 1.347 0 0.534 C 0.184 0.433 0.39 -0.09 0.565 0.015 Z" height="0.992" width="0.565" winding="nonZero" x="2.694" y="3.177">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.224 0.443 C 0.282 0.479 0.144 0.832 0.112 0.918 C 0.097 0.583 -0.068 0.268 0.033 0 C 0.048 0.342 0.142 0.289 0.224 0.443 Z" height="1.084" width="0.239" winding="nonZero" x="1.011" y="34.817">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.335 2.472 C 0.16 2.367 0.021 0.878 0 0 L 0.335 2.472 Z" height="2.919" width="0.335" winding="nonZero" x="0.783" y="40.641">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.225 0.357 C 0.076 0.916 -0.004 0.762 0 0.008 C 0.093 -0.046 0.14 0.203 0.225 0.357 Z" height="0.818" width="0.225" winding="nonZero" x="0.172" y="50.798">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.199 0.02 C 0.203 0.559 0.101 0.827 0 1.089 C 0.15 1.07 -0.094 -0.159 0.199 0.02 Z" height="1.286" width="0.199" winding="nonZero" x="0.596" y="51.739">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.095 0.038 C 0.108 0.376 0.254 1.108 0.06 1.423 C 0.195 1.07 -0.162 -0.224 0.095 0.038 Z" height="1.681" width="0.159" winding="nonZero" x="0.192" y="68.345">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.219 0 C 0.207 0.211 0.176 0.298 0.224 0.542 C 0.144 0.931 0.016 0.521 0 0.194 L 0.219 0 Z" height="0.825" width="0.224" winding="nonZero" x="0.332" y="76.116">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.087 0.708 L 0 0 L 0.174 0.104 L 0.087 0.708 Z" height="0.836" width="0.174" winding="nonZero" x="1.167" y="215.937">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.192 0 C 0.301 0.705 0.028 0.49 0.001 0.608 C -0.017 -0.029 0.217 0.845 0.192 0 Z" height="0.718" width="0.219" winding="nonZero" x="1.072" y="278.409">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
              <s:Path data="M 0.005 0.215 L 0 0 L 0.359 0.071 L 0.005 0.215 Z" height="0.254" width="0.359" winding="nonZero" x="2.133" y="311.389">
                   <s:fill>
                        <s:SolidColor color="#202020"/>
                   </s:fill>
              </s:Path>
         </s:Group>
         <s:transitions>
              <s:Transition fromState="normal" toState="hovered" autoReverse="true">
                   <s:Parallel>
                        <s:Parallel target="{time}">
                             <s:Move duration="0" autoCenterTransform="true"/>
                             <s:Resize duration="0"/>
                        </s:Parallel>
                        <s:Parallel target="{subject}">
                             <s:Fade duration="0"/>
                        </s:Parallel>
                        <s:Parallel target="{workshop}">
                             <s:Fade duration="0"/>
                        </s:Parallel>
                        <s:Parallel target="{workshop2}">
                             <s:Fade duration="0"/>
                        </s:Parallel>
                        <s:Parallel target="{workshop3}">
                             <s:Fade duration="0"/>
                        </s:Parallel>
                        <s:Parallel target="{workshop4}">
                             <s:Fade duration="0"/>
                        </s:Parallel>
                        <s:Parallel target="{footerGroup">
                             <s:Fade duration="0"/>
                        </s:Parallel>
                   </s:Parallel>
              </s:Transition>
         </s:transitions>
    </s:ItemRenderer>

    Wouldn't I then just get one image? Whereas what I want is if
    the value = 1, display 1 image. If the value = 2, display 2 images.
    Thus creating a bar of images.
    Im actually having trouble adding multiple images to the HBox
    in the itemRenderer.

  • Item renderer question

    I have an item renderer that adds a checkbox to my tree and
    checks it. My problem is that when i uncheck the box and scroll
    down the tree there are random boxes that are unchecked. Does
    anyone know how to get around this? Here is the renderer, and any
    help would be greatly appreciated!!
    package components
    import mx.core.Container;
    import mx.core.IDataRenderer;
    import mx.controls.CheckBox;
    import mx.controls.treeClasses.*;
    import mx.collections.*;
    import flash.xml.*;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import mx.controls.Alert;
    import mx.controls.listClasses.*;
    public class myTreeItemRenderer extends TreeItemRenderer
    private var nodeType:String;
    // myCheckBox: holds the CheckBox we are adding to the tree
    nodes
    protected var myCheckBox:CheckBox;
    // set the margin between the image we are adding, and the
    label
    private var cbToLabelMargin:Number = 2;
    // show default branch icon?
    private var showDefaultBranchIcon:Boolean = false;
    // show default leaf icon?
    private var showDefaultLeafIcon:Boolean = false;
    public function myTreeItemRenderer()
    super();
    // InteractiveObject variables.
    mouseEnabled = false;
    public function openBranch(evt:Event):void
    // get the TreeListData
    var myListData:TreeListData = TreeListData(this.listData);
    // get the selected node
    // var selectedNode:Object = myListData.node;
    var selectedNode:Object = myListData.item;
    var selectedNodeXML:XMLList = new XMLList(selectedNode);
    // get the tree that owns us
    var theTree:Tree = Tree(myListData.owner);
    // find out if the selected branch is already open
    //var isBranchOpen:Boolean = theTree.getIsOpen( selectedNode
    //mx.controls.Alert.show(selectedNode.toString());
    // if the selected branch is open, let's close it
    // and if it's closed, let's open it
    //var isBranchOpen:Boolean = isBranchOpen ? false : true;
    //theTree.setIsOpen( selectedNode, isBranchOpen, true, false
    if(theTree.id=="soTree")
    this.parentApplication.soCheckBoxChanged(evt,selectedNodeXML);
    //mx.controls.Alert.show(selectedNodeXML.attribute('id')+"
    "+selectedNodeXML.attribute('type')+" False");
    else if(theTree.id=="ntaTree")
    override protected function createChildren():void
    // create a new CheckBox() to hold the CheckBox we'll add to
    the tree item
    myCheckBox = new CheckBox();
    myCheckBox.setStyle( "verticalAlign", "middle" );
    myCheckBox.selected=true
    // and apply it to the tree item
    addChild(myCheckBox);
    // add the event listener to the whole tree item
    // this will let us click anywhere on the branch item to
    expose the children of this branch
    myCheckBox.addEventListener( MouseEvent.CLICK, openBranch );
    super.createChildren();
    override public function set data(value:Object):void
    if(value==null)
    return;
    else
    super.data = value;
    // get the tree that owns us
    var _tree:Tree = Tree(this.parent.parent);
    // if the current node is a branch node
    if(TreeListData(super.listData).hasChildren)
    // set styles...
    setStyle("color", 0x000000);
    setStyle("fontWeight", 'bold');
    // if we don't want to show the default branch icons, let's
    empty them
    if( !showDefaultBranchIcon )
    _tree.setStyle("folderClosedIcon", null);
    _tree.setStyle("folderOpenIcon", null);
    else
    // if we are in here, then the current node is a leaf node
    // set styles...
    setStyle("color", 0x000000);
    setStyle("fontWeight", 'normal');
    // if we don't want to show the default leaf icons, let's
    empty them
    if( !showDefaultLeafIcon )
    _tree.setStyle("defaultLeafIcon", null);
    override protected function
    updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    if(super.data)
    // if the current node is a branch
    if(TreeListData(super.listData).hasChildren)
    // get the current node and it's children as XMLList
    // var currentNodeXMLList:XMLList = new
    XMLList(TreeListData(super.listData).node);
    var currentNodeXMLList:XMLList = new
    XMLList(TreeListData(super.listData).item);
    nodeType= currentNodeXMLList.attribute('type');
    // get the number of children under the current node
    var numOfImmediateChildren:int =
    currentNodeXMLList[0].children().length();
    // set the image to be displayed in the branches
    //myImage.source = branchImage;
    // set the label text
    super.label.text = TreeListData(super.listData).text + "(" +
    numOfImmediateChildren + ")";
    else
    // if we are in here, then the current node is a leaf node
    //myImage.source = leafImage;
    // reset the position of the image to be before the label
    myCheckBox.x = super.label.x;
    // reset the position of the label to be after the image,
    plus give it a margin
    super.label.x = myCheckBox.x + 10 + cbToLabelMargin;
    }

    Hi,
    The links you have refered are really useful. Unfortunatelly, my environment is just flex sdk 3.
    So I have to find some other solution to finish this logic.
    Nith

  • Datagrid and Inline Item renderer problem

    I have a datgrid with two inline item renderers. The dataprovider for my DG is a nested object (objects within objects within objects i.e 3-layered).
    Main Object - 1st Level
                              |
                  2nd Level Object 1
                                    |
                                3rd level object '1' => ('name'=>somename,'id'=>someid)
                                3rd level object '2'
                                3rd level object 'n'
                 2nd Level Object 2
                                    |
                                3rd level object '1' => ('name'=>somename,'id'=>someid)
                                3rd level object '2'
                                3rd level object 'n'
    I use 2 item renderers (one for each datagrid column) which loops thro the 2nd level object1 and 2 respectively (the 2nd level object is a dynamic array of objects, in that the number of objects within keep changing).
    Within the item renderer I loop thro the 2nd level object using a foreach and then display the data. The data is a linkbutton, which when clicked , calls a remote object function to delete the data from the database
    now on the result event of the remote object function call, i call the function to repopulate the DG, so that the updated data is displayed.
    When i click on the linkbutton in the first row, the backend works perfectly fine (the data gets deleted from the database and the refreshed data is sent back), but for some reason, the deleted data suddenly appears in the 2nd row.
    When i delete it from the second row, it appears on the 3rd row (nothing happens in the backend since the data is already deleted).. and so on, till it appears on the last row and then the DG looks exactly the way it shld have looked after the first delete.
    This is just the beginning. The second item renderer also displays a linkbutton, which when clicked, displays that data in the previous column (the one where this data can be deleted). When i click on 1st row, the data gets added in the previous column of the second row .. and so on..
    Basically, my DG is acting really weird. I overrided the set data function in the item renderer to refrsh the data and called its invalidateDisplayList. I also call the Datagrid's invalidateDisplayList function after each refresh.  The behavior remains the same.
    Please help me on this ...

    Hi, Post a test code.... It will be a lot easier to help you Mich

  • Datagrid Drop Down Item renderer Scroll Problem

    Hi,
    I am having a problem with an drop down item renderer on a Datagrid.  When ever the datagrid is displayed and the cell is clicked on i want this to display a drop down list of objects.  I can get the drop down to appear with the list of objects.  H
     owever the scrollbar does not work on this item to allow the user to scroll through all the objects.  If you use the mouse wheel you can scroll down through them all but not when you try and click on the scroll bar to drag down.  Below is the code used.  Any advice why this might be happening?? 
    <mx:DataGridColumn headerText="Widget"
    dataField="WidgetName"
    editable="true"  headerWordWrap="false" textAlign="center" width="100"
    editorDataField="Widget">
    <mx:itemEditor>
    <fx:Component>
    <s:MXDataGridItemRenderer focusEnabled="true" height="22" >
    <fx:Script>
    <![CDATA[               
    import mx.events.FlexEvent;
    import spark.events.IndexChangeEvent;
    private var selectedWidget:Widget = null;
    public function get ccyPair():String {
    return  ddlCcyPairs.selectedItem.Widget;
    override protected function commitProperties():void {
    super.commitProperties();                
    trace("Commit .......");
    protected function ddlCcyPairs_changeHandler(event:IndexChangeEvent):void {
    for each(var ccyP:CurrencyPair in ddlCcyPairs.dataProvider) {
    if (ccyP.ccyPair == ddlCcyPairs.selectedItem.ccyPair) {
    selectedWidget = ccyP;
    ddlCcyPairs.selectedItem = selectedWidget;
    protected function ddlCcyPairs_creationCompleteHandler(event:FlexEvent):void {                 
    for each(var ccyP:CurrencyPair in ddlCcyPairs.dataProvider) {
    if (ccyP.ccyPair ==  data.ccyPairName) {
    selectedWidget = ccyP;
    ddlCcyPairs.selectedItem = selectedWidget;
    ]]>
    </fx:Script>
    <s:DropDownList id="ddlWidgets" width="100%"
    dataProvider="{parentApplication.Widgets}"
    labelField="name"              
    selectedItem="selectedWidget"
    creationComplete="ddlWidgets_creationCompleteHandler(event)"
    change="ddlWidgets_changeHandler(event)"/>
    </s:MXDataGridItemRenderer>
    </fx:Component>
    </mx:itemEditor>
    </mx:DataGridColumn>

    Hi, Post a test code.... It will be a lot easier to help you Mich

  • DataGrid Item Renderer loading duplicates after scroll

    HI,
    I have a report that loads into a datagrid, these reports are
    about thumbnail images that are on a server.
    I have a datagrid item renderer that loads the thumb nails.
    When the grid first loads the first set of rows that are visible
    display the correct images. But after I scroll the new rows have
    images that are repeated and not the correct ones.
    ?xml version="1.0" encoding="utf-8"?>
    <HBox xmlns="
    http://www.adobe.com/2006/mxml"
    horizontalScrollPolicy="off" verticalScrollPolicy="off"
    creationComplete="{init()}">
    <Script>
    <![CDATA[
    import mx.controls.Image;
    [Bindable]
    [Embed(source="/images/folderBlack.png")]
    private var folderIcon:Class;
    private function suffix(url:String):String {
    var i:Number;
    if ((i = url.lastIndexOf(".")) > -1) {
    url = url.substr(i+1);
    return url;
    private function init():void {
    var fileSuffix:String = new String;
    fileSuffix = '';
    fileSuffix = suffix(data.filename);
    var staticPortalImage:String = new String;
    staticPortalImage = '/PULLIMAGE.php?type=small&id=' +
    data.FileID +
    '&path=' + data.filename +
    '&server=MTI3LjAuMC4x&siteurl=L0F1dGhNb2R1bGU=';
    var thumbNailImage:Image = new Image();
    thumbNailImage.height = 80;
    switch(fileSuffix){
    case 'jpg':
    thumbNailImage.source = staticPortalImage;
    break;
    imageContainer.addChild(thumbNailImage);
    texttest.text = fileSuffix;
    ]]>
    </Script>
    <Text id="texttest" />
    <HBox id="imageContainer" height="80" />
    </HBox>

    Thanks
    Great article I ended up getting rid of the creationcomplete
    changing my init():void too override public function set data(
    value:Object ) : void
    and adding
    super.data = value;
    I was able then to clean up my code considerably.
    Once again Thanks
    Dean

  • How to access item renderer from main mxml?

    Hi,
    I have a datagrid which has item renderer. Code looks like this:
    <mx:DataGrid id="newsfeedgrid" width="100%" height="100%" visible="true" verticalScrollPolicy="auto"
                                  verticalGridLines="false" horizontalGridLines="true" horizontalGridLineColor="#E5F0F3" showHeaders="false"
                                  rowHeight="70" wordWrap="true" resizableColumns="false">
                                  <mx:columns>
                                            <mx:DataGridColumn headerText="Image Name" dataField="imgname" width="100">
                                            <mx:itemRenderer>
                                                      <mx:Component>
                                                                <mx:VBox height="100%" width="100%">
                                                                <!--          <mx:Image source="{data.imgname}" height="100%" width="100%"/>-->
                                                                <local:SmoothImage source="{'http://localhost/musicbook/attachdoc/'+data.imgname}" height="100%" width="100%"/>
                                                                          <mx:Text text="{data.fname+' '+data.lname}" fontSize="10" fontWeight="bold" fontFamily="Verdana" color="#3D3636"/>
                                                                </mx:VBox>
                                                      </mx:Component>
                                            </mx:itemRenderer>
                                            </mx:DataGridColumn>
                                            <mx:DataGridColumn headerText="Messages" dataField="mymsg" wordWrap="true" resizable="true"
                                                      >
                                                      <mx:itemRenderer>
                                                                <mx:Component>
                                                                          <mx:VBox verticalScrollPolicy="off" creationComplete="lbl_initialize()">
                                                                                    <!--<mx:HBox width="100%">
                                                                                              <mx:Text text="{data.uname}" width="100%" color="BLUE" fontSize="10" fontWeight="bold"
                                                                                              useHandCursor="true" buttonMode="true" mouseChildren="false"
                                                                                              click="this.outerDocument.userPage('msgFromC onnGrid')"/>
                                                                                              <mx:Text text="{data.actmsg}" width="100%" fontSize="10" fontWeight="bold"
                                                                                              />
                                                                                              <mx:Text text="{data.secuname}" width="100%" color="BLUE" fontSize="10" fontWeight="bold"
                                                                                              useHandCursor="true" buttonMode="true" mouseChildren="false"
                                                                                              click="this.outerDocument.userPage('msgFromC onnGrid')"/>
                                                                                    </mx:HBox>-->
                                                                                    <mx:Text id="lbl" width="100%"
                                                                            selectable="true"
                                                                            link="lbl_link(event);" />
                                                                                    <!--<mx:ControlBar id="cbar">-->
                                                                                    <mx:Spacer height="50%"/>
                                                                                    <mx:HBox width="100%">
                                                                                    <mx:Text text="{data.datetime}" fontSize="7" color="#8B9698"/>
                                                                          </mx:HBox>
                                                                           <mx:Script>
                                                                        <![CDATA[
                                                                            import mx.controls.Alert;
                                                                                    public var tempsecuname:String;
                                                                            private function lbl_initialize():void {
                                                                                      /* if(lbl.text=="Pratik is good")
                                                                                                lbl.htmlText="<a href='event:flex.org'>Good</a> is Pratik";
                                                                               //lbl.htmlText = "For more information on Flex, see <u><a href='event:flex.org'>http://www.flex.org/</a></u>.";
                                                                                if(data.secuname==null)
                                                                                          tempsecuname = "";
                                                                                else
                                                                                          tempsecuname=data.secuname;
                                                                               lbl.htmlText="<a href='event:flex.org'><font color='#2112EF'><b>"+data.uname+"</b></font></a>"+data.actmsg+"<a href='event:flex.org'><font color='#2112EF'><b>"+tempsecuname+"</b></font></a>";            
                                                                            private function lbl_link(evt:TextEvent):void {
                                                                                Alert.show(evt.toString(), evt.text);
                                                                                switch (evt.text) {
                                                                                    case "flex.org":
                                                                                        // You clicked the flex.org link.
                                                                                        break;
                                                                        ]]>
                                                                    </mx:Script>
                                                                          </mx:VBox>
                                                                </mx:Component>
                                                      </mx:itemRenderer>
                                            </mx:DataGridColumn>
                                  </mx:columns>
                                            </mx:DataGrid>
    Problem currently is since lbl_initialize() function is called on creationComplete of Vbox, output displayed is not expected and when ever i navigate to grid page output gets changed and it is not proper.
    I wanted to use text ,lbl, in my main.mxml so that i can assign the value when i am setting data provider.
    Please help!!!

    Thanks for your reply.. overriding set data in fact is a better approach and my half problem is solved but i am still facing some issues. Please find my code below:
    <mx:DataGridColumn headerText="Messages" dataField="mymsg" wordWrap="true" resizable="true"
                                                      >
                                                      <mx:itemRenderer>
                                                                <mx:Component>
                                                                          <mx:VBox verticalScrollPolicy="off" >
                                                                                    <mx:Text id="lbl" width="100%"
                                                                            selectable="true"
                                                                            link="lbl_link(event);" />
                                                                                    <!--<mx:ControlBar id="cbar">-->
                                                                                    <mx:Spacer height="50%"/>
                                                                                    <mx:HBox width="100%">
                                                                                    <mx:Text text="{data.datetime}" fontSize="7" color="#8B9698"/>
                                                                          </mx:HBox>
                                                                           <mx:Script>
                                                                        <![CDATA[
                                                                                  import mx.core.Application;
                                                                            import mx.controls.Alert;
                                                                                    public var tempsecuname:String;
                                                                                    public var tempmsg:String="";
                                                                                   override public function set data( value:Object ) : void {
                                                        super.data = value;
                                                                               lbl.htmlText="<a href='event:data.uname'><font color='#2112EF'><b>"+data.uname+"</b></font></a>"+tempmsg;
                                                                               if(data.datetime>Application.application.lastlogout)
                                                                                         Alert.show(Application.application.lastlogout);
                                                                                         lbl.setStyle("fontWeight","bold");
                                                                            private function lbl_link(evt:TextEvent):void {
                                                                        ]]>
                                                                    </mx:Script>
                                                                          </mx:VBox>
                                                                </mx:Component>
                                                      </mx:itemRenderer>
                                            </mx:DataGridColumn>
    Now my text is coming properly with link like how i wanted. I have added here another functionality where I am checking the last logouttime of user and the msg time and if msgtime is greater than last logout time then i am showing it in bold.
    override public function set data( value:Object ) : void {
                                    super.data = value;
                    lbl.htmlText="<a href='event:data.uname'><font color='#2112EF'><b>"+data.uname+"</b></font></a>"+tempmsg;
                    if(data.datetime>Application.application.lastlogout)
                    Alert.show(Application.application.lastlogout);
                    lbl.setStyle("fontWeight","bold");
    First time is shows properly but if i scroll then some random row is also appearing in bold, also when ever this set data function is getting called some random rows are coming in bold.
    Please let me know your input

  • Zoom item renderer out of scroller boundaries

    Hi everyone, hoping someone has the easy Answer.  I want to have an item renderer that can zoomIn and display outside the scroller boundaries for which it resides in. 
    I have
    Scroller  set depth property =1
    |
    Datagroup (tile layout) depth=2
    |
    custom zoomable LabelItemRenderer depth=3  (depth=4 when zooming in so it overlaps the other renderers in the datagroup) ....these tiles, when zoomed, will increase in size by 50%.
    So in other words, the datagroup is wrapped in a scroller, and I extended the LIR to zoom.
    If I take the scroller out of the picture, everything works great...if I zoom on an IR(tile) that is on the very border of the datagroups boundaries, it will display over the DG's boundaries so that the whole zoomed tile is shown.
    Now if I wrap the DG in a scroller, the IRs will zoom, but any tiles on the boundary will get clipped by the boundary, like it is underneath the scroller.
    I want a zoomed tile to display completely, even if that means overlapping the boundaries of the scroller.  Like I said, works great when the DG doesn't have a scroller wrapped around it.
    Is this possible?
    I should add its a 4.6 mobile project.

    I don't use jbuilder
    This is what apears at the commandpromt:
    Exception occurred during event dispatching:
    java.lang.OutOfMemoryError
            <<no stack trace available>>
    Exception occurred during event dispatching:
    java.lang.OutOfMemoryError
            <<no stack trace available>>
    java.lang.OutOfMemoryError
            <<no stack trace available>>
    java.lang.OutOfMemoryError
            <<no stack trace available>>This is the version of java i use (I use the compiler that comes with it it does not answer to -version itself)
    java version "1.3.1"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
    Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)This is my ListCell renderers get method:
         public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus)
              String[] ss=((arrayjanus) value).getArray();
              JPanel p=new JPanel();
              p.setLayout(new BoxLayout(p,BoxLayout.X_AXIS));
              for(int i=0;i<lenghts.length;i++)
                   JTextField jt=new JTextField(lenghts);
                   jt.setText(ss[i]);
                   jt.setCaretPosition(0);
                   p.add(jt);
              return p;
    I run in the same problem if i switch of the DB access and on a selection do nothing but System.out.println the count of selections (I get it after ~ 800 clicks in rapid succession under theese circumstances)
    I am having about 50 items in the list.

Maybe you are looking for