When you modify the typo of text, you have to consider that there is two elements to take in consideration. The first one is the text, the string itself. For example, “Hi man” in Arial means the same thing as “Hi man” in Times New Roman.
The second thing is the typo. It’s the “style” of the string.
In your case, you want to send a string, attach it a typo and be able to reload it.
I dont really understand entirely what you want to do. Do you want to…
1- Send an html string to a db, read it back and load it in an html?
2- Send a string with the format that YOU decided (for example, all html in your text editor would be yellow) ?
If your case is Question 1, it’s easy : just send as a string to the db your entire text, with the html brackets.
If your case is Question 2, it’s HARD. Real hard, but it can be done. What you will have to do is put your entire text (what the user have done in your editor) in a single string. After, you will have to modify it in order to put you “personnal markers” that, after loading it from the db, will tell you what to do at specific moment in your string (ie jump a line, change color, etc).
This process is called “parsing”.
Let’s take an example. You have this html code :
hello my name is < g1 >Bobby< /g1 >.
(okay, < g1 > means nothing, but you get the point.)
I suppose that what you want to do, is but “< g1 >Bobby< /g1 >” in yellow, for example.
You will have to put the entire text in a string and modify it in order to add something like :
hello my name is [this_clr=yellow]< g1 >Bobby< /g1 >[stop_clr].
While you will read back the string from the db, you will know that after “[this_clr=” there is the name of the color until you hit the next closing bracket, ‘]’. The following text will be of that color, until you read “[stop_clr]”.
For parsing, you will need to learn how to use all the methods of the String type (substr, concat, charAt, etc…)
As you can see, that’s not an easy job.
But maybe I don’t answer to your question? Maybe what you really want to do, is to always use the same customized type for all code in < g1 > and < /g1 >, for example. If THAT is your case, simply send your html string to the db. When you will retreive it back, parse your string using the substr() function, for example. “Intercept” the < g1 > code and when you will read it, change the color of the text in your swf until the next < /g1 >.
Man, you have an interresting project but not the easiest one !
I hope that my explanation have help you.
Oh and btw, ALWAYS use a font like Courrier for html (or any coding editor) otherwise you won’t be able to indent correctly your code.