Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
Jaguar280 #1
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
-
How do I put line break in my asp page?
Try: <br> <br> <br> "Jules" <jules.farrell@james-chapman.co.uk> wrote in message... -
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... -
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... -
line break in a datagrid
hello to all, how to get an line break from a database to the datagrid? thanks, hannes -
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... -
atta707 #2
Re: inserting line break within label
1) change your #13 to 
.
2) increase to height of the label to, let's say, 40 pixels
should work.
atta707 Guest
-
Jaguar280 #3
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



Reply With Quote

