Thanks Jason,
 
I think I am looking for a way to set the itemFocusIn and itemFocusOut to make stateChange on the VBox!
 
Sree
 
----- Original Message -----
Sent: Thursday, June 22, 2006 1:01 AM
Subject: RE: [flexcoders] States within List

Sree,

            You can create an ItemRenderer based on any UIComponent and add your states into that. Then assign that ItemRenderer to your List. I have started working on an example. This is not complete because it doesn’t handle selecting an item. But it should be a good starting point.

DynamicListItemRenderer.mxml:

<?xml version="1.0" encoding="utf-8"?>

<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" borderStyle="solid" backgroundColor="0xFFFFFF"

            verticalGap="-2" cornerRadius="4" borderColor="0x000000"

            rollOver="currentState='expanded'" rollOut="currentState=''">

           

           

            <mx:transitions>

                        <mx:Transition fromState="*" toState="*">

                                    <mx:Resize target="{this}" duration="300"/>       

                        </mx:Transition>

            </mx:transitions>

           

            <mx:states>

                        <mx:State name="expanded">

                                    <mx:AddChild creationPolicy="all">

                                                <mx:Label text="{data.desc}"/>

                                    </mx:AddChild>

                        </mx:State>

            </mx:states>

           

            <mx:Label text="{data.label}"/>

           

</mx:VBox>

Main.mxml:

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" width="600" height="500" preinitialize="initList()">

            <mx:Script>

                        <![CDATA[

                                    import mx.collections.ArrayCollection;

                                   

                                    [Bindable]

                                    public var dataList:ArrayCollection;                   

                                   

                                    public function initList():void

                                    {

                                                dataList = new ArrayCollection([{label:"One", desc:"The US won the game on a last second goal"},

                                                                                                                                                {label:"Two", desc:"The pressure was too much to overcome"},

                                                                                                                                                {label:"Four", desc:"Look for exciting matchups"}]);

                                    }

                                   

                        ]]>

            </mx:Script>

            <mx:List id="mainList" itemRenderer="DynamicListItemRenderer" variableRowHeight="true"

                        width="100%" height="300" dataProvider="{dataList}"/>

</mx:Application>


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Sreejith Unnikrishnan
Sent: Wednesday, June 21, 2006 12:23 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] States within List

Is it possible to create states within a List that changes height on select?

Basically, I need to switch between a simple and advanced view in a list only on select.

I tried using a Repeater in a VBox, but navigating up and down using arrow keys is not possible(?) when using a repeater.

Any guidance is appreciated.

Thanks

Sree

__._,_.___

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