2 Replies Latest reply on May 4, 2008 10:09 PM by Jaguar280

    inserting line break within label

    Jaguar280 Level 1
      Hey guys,

      i've run into a small problem with the coding. right now im creating image viewer within a horizontal list. at first, i had each object coded inside the horizontal list but then i decided to place everything in an xml file to make changes easier. since i've switched, i have not been able to figure out how to insert a line break for each label. this is what the code looked like when i was naming each object.

      <mx:HorizontalList id="PosterSelect" height="352" columnCount="3" columnWidth="200" width="580"
      rollOverColor="#ff3344" themeColor="#DC240B" itemClick="itemClicked(event)">
      <mx:dataProvider>
      <mx:Array>
      <mx:Object id="object1" label="March 12, 2008& #13;Chicago, IL" data="events"/>
      <mx:Object id="object2" label="March 12, 2008& #13;Chicago, IL" data="events"/>
      <mx:Object label="March 12, 2008& #13;Chicago, IL" icon="{event3}" data="events"/>
      <mx:Object label="March 12, 2008& #13;Chicago, IL" icon="{event4}" data="events"/>
      <mx:Object label="March 12, 2008& #13;Chicago, IL" icon="{event5}" data="events"/>
      </mx:Array>
      </mx:dataProvider>
      </mx:HorizontalList>

      within the label property, i used the & #13; character to insert a line break. now im using an item renderer to call the information from my xml file. the problem is... i cannot figure out how to insert a line break like i did previously. from what i understand... the text in the label field of the xml file is already parsed when it comes into flex. so using the & #13; or \n characters will not work. i also tried hitting enter to insert a new line in the xml file but that did not work either. does anyone know how i could work around this?? below is my current code and xml

      <eventinfo>
      <events>
      <label>March 12, 2008#13;Chicago, IL</label>
      <group>group name</group>
      <location>Detroit, MI</location>
      <icon>posters/event1.png</icon>
      <fullsize>posters/event1.png</fullsize>
      </events>
      <events>
      <label>March 12, 2008#13;Chicago, IL</label>
      <group>group name</group>
      <location>Detroit, MI</location>
      <icon>posters/event4.png</icon>
      <fullsize>posters/event1.png</fullsize>
      </events>
      </eventinfo>

      <mx:HorizontalList id="HorizontalCanvas" height="337" columnWidth="180" width="672"
      rollOverColor="#ff3344" themeColor="#DC240B" itemClick="callJavaScript()" x="10" y="33" borderStyle="solid" dataProvider="{eventinfo.events}" borderColor="#000000">
      <mx:itemRenderer>
      <mx:Component>
      <mx:VBox width="100%" height="350" horizontalAlign="center">
      <mx:Image source="{data.icon}"/>
      <mx:Label text="{data.label}"/>
      </mx:VBox>
      </mx:Component>
      </mx:itemRenderer>
      </mx:HorizontalList>