This content has been marked as final. Show 7 replies
Use the XML new line character:
So your XML element would look like this:
I wouldn't recommend forming your data like this though. It'd probably be best to set each value separately within the XML doc and then write the logic in ActionScript to create the new line for the elements you want.
Thanks for d help buddy
iM a designer and a i have very pathetic skills in programming like AS etc
Can u plz explain your method of formatting data along with a working code?
waiting and once again thanks for d help :)
No problem. Before I help out with some code, can you give me an idea of the context in which you're using the data. For example, I imagine a portion of the XML file could look something like this:
my xml file`s structure iz following
2 different "Text" Components [as i changed TextArea to Text] are caputring all above 2 fields
Bundle of Thanks Buddy for the "
" as it works perfect
can you plz tell me where i get the information of these formating stuff [similar to
Why AS based way of \n is best? does AS based method works fast or something else?
Waiting for your favourable Reply
You can find info on special characters at xml.org and unicode.org. Do a search for 'xml and html characters'. An example would be for the copyright symbol... the Unicode code is 00A9, so within an XML element you'd write �A9;
As far as using AS to add the newline... it will give you greater control if the XML elements are represented as separate values in the database field (of course assuming the XML is dynamically assembled during a service call). However, using your approach of directly embedding the newline character in your XML data would be faster, especially if the data is only going to be used by you for your specific application.
Here's a sample of how it could be handled if the XML data is dynamically assembled with the following format and returned in e4x resultFormat from the service call:
var apps:XMLList = event.result.tech.app;
var tmpStr:String = "";
if (apps.length() > 1)
for (var a:int = 0; a < apps.length() - 1; a++)
tmpStr += apps[a] + "\n";
tmpStr += apps[apps.length() - 1];
tmpStr += apps;
Technologies.text = tmpStr;
You can see how you have greater control over what you want to do with the data. If you're the only one who will ever use this data and only for your specific application, then the AS route is probably overkill, but it may come in handy to know how to do it.
If iM not wrong XMLList is an Array and you wrote a for loop for creating new line...
Thanks, this code dznt only help me to use \n but I also got knowledge about XMLList and the way of using for loop in Flex...
I have the basic concepts of Programming Techniques [C++] but I havenot a practical experience, so I face difficulty to write a new code from myself, But my little knowledge help me to understand the code and use it in future...
You are simply Awesome
iM sure you ll help me in future problems as well
have a nice time