0 Replies Latest reply on Dec 15, 2007 6:34 AM by Sypher_04

    Need some help with event.

    Sypher_04
      Okay, basically I have an NewsRenderer, which gets its data from an XML document in the project, and spits it out into a tileList control. That is working no problem, however I created a second state for the newsRenderer, called Expanded, and I would like to switch between them when the tileList item is selected. I'm not sure if this can be handled from the Main MXML or if it has to be done from the NewsRenderer.

      This is the code for the news renderer:
      quote:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" width="380" height="70" horizontalScrollPolicy="off" verticalScrollPolicy="off">
      <mx:states>
      <mx:State name="Expanded">
      <mx:SetProperty name="height" value="190"/>
      <mx:AddChild position="lastChild">
      <mx:Text x="10" y="78" text="{data.description}" width="360" height="81"/>
      </mx:AddChild>
      <mx:AddChild position="lastChild">
      <mx:Button x="270" y="158" label="Read more..."/>
      </mx:AddChild>
      </mx:State>
      </mx:states>
      <mx:transitions>
      <mx:Transition fromState="*" toState="*">
      <mx:Resize target="{this}" />
      </mx:Transition>
      </mx:transitions>
      <mx:Fade id="fade" target="this" />
      <mx:Image source="cook.jpg" height="70" width="80" />
      <mx:Text text="{data.name}" height="22" width="300" x="80" textAlign="left" fontFamily="Georgia" fontSize="16" fontWeight="bold" color="#0000a0"/>
      <mx:Text text="{data.author}" height="20" width="300" x="80" y="22" textAlign="left" fontSize="12"/>
      <mx:Text text="{data.date}" height="20" width="300" x="80" y="50" textAlign="left" fontSize="9" color="#ff0000"/>
      <mx:HRule x="80" y="46" width="300" height="2"/>
      </mx:Canvas>


      And here is the tilelist:
      quote:

      <mx:TileList dataProvider="{news.story}" itemRenderer="NewsRenderer" width="425" bottom="-97"
      top="243" x="180" direction="vertical" allowMultipleSelection="false" enabled="true"
      id="tileListNews" variableRowHeight="true"></mx:TileList>


      Any help would be greatly appreciated. Thanks