Flash, XML, formatting
- Started
- Last post
- 15 Responses
- pushme
I have a need to store static data in an xml document. However i also need the ability to format it w/ HTML tags(tables, bullets, etc.) I've looked around and am not finding a good way to go about doing this in Flash MX. Any suggesitons would be great.
- unfittoprint0
store your information ina MySQL database. You cadd, delete, modify your records there. And withe usage of PHP you can query it and output the result as XML.
- pushme0
Unfortunately I'm limited to XML & Flash. I don't have the luxury of dbases or PHP. I'm coming in on the tail end of project where 95% of production is done. All they want is static data stored in external files for random updates. Had I started the project i would've done it much differently but no such luck.
- unfittoprint0
right.
well the only way to use HTML code in an XML , is to contain it using CDATA tags.
- pushme0
thx.
it read what was in the cdata section but instead of bolding it returned Hello
- unfittoprint0
it works 4 me.
name your textBox [ie.txtBox] and use the follwoing [after 'clicking the render text as html' in the properties box]:
ie:
txtBox.htmlText = XMLObject.childnode.nodeValue...
- shaft0
AFAIK flash converts cdata section to unicode entities. You don't have an
- pushme0
Thx Unfit!
- shaft0
continued:
..you don't have an < or > but their unicode representetion. A quick way out is to load the node into a textfield and take it from there again.
- pushme0
NOt sure what you mean Shaft.
- jkosoy0
workinf off of unfit... when I do such things, I often code the HTML I embed in the XML using brackets [ ] instead of tags < >.
Then in Flash I convert...so building off of what he was talking about...
txtBox.htmlText = XMLObject.childnode. nodeValue
txtBox.htmlText.split("[p]").joi... etc for all the HTML tags.
- shaft0
Guess what.. my client just asked me how to put html into his xml config file, so I had to go over this very issue again. Forget what I wrote in my previous posting, my mistake was I had been using .text property instead .htmlText. It's working ok now without the hassle I described before.
- ********0
Flash -> PHP -> dB (MySQL) -> PHP -> XML -> Flash
- shaft0
Path of the day JazX ? :)
- alexkx0
Flash MX 2004.
- jevad0
* pushes pushme