inserting line break within label

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default inserting line break within label

    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>

    Jaguar280 Guest

  2. Similar Questions and Discussions

    1. How do I put line break in my asp page?
      Try: <br>&nbsp;<br>&nbsp;<br> "Jules" <jules.farrell@james-chapman.co.uk> wrote in message...
    2. line break
      I can't seem to get the line break to work in Contribute, so when I hit SHIFT + ENTER, it still gives a Paragraph tag. According to the help, it...
    3. Forced line break changes previous line endings
      Gang-- Give this script a try. It's quite experimental (i.e., use at your own risk), but in my tests it actually works to "freeze" the line...
    4. line break in a datagrid
      hello to all, how to get an line break from a database to the datagrid? thanks, hannes
    5. Can't seem to remove line break..
      Hello all, In my PHP script I put a text file into a string. Part of that string is read, changed and removed. The while loop continuest to...
  3. #2

    Default Re: inserting line break within label

    1) change your #13 to &#13.
    2) increase to height of the label to, let's say, 40 pixels

    should work.
    atta707 Guest

  4. #3

    Default Re: inserting line break within label

    hey atta,

    sry, i was using the character but for some reason when i posted the
    character it turned into a space so i added the space inbetween the & and the
    #13;

    but yea i think it was the height... changed it to 40 and it worked.. i cant
    believe i didnt notice that lol... oh well... thx for the help!!!

    Jaguar280 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139