PDA

View Full Version : ComboBox and TextArea(HTML)


Joelito
07-31-2007, 03:11 PM
Hi...
I have in my escenario a ComboBox, Button and TextArea with HTML enable.
I know this:
1. Detect comboBox change event.
2. Detect Button click event.

My problem is that I need to load some html files upon combobox index:

function Combo_onChange(evento) {
nIndex = evento.target.selectedIndex;
}

function Button_onClick(evento) {
if (nIndex >= 1) {
var dat:String = Grupos_xml.firstChild.childNodes[nIndex-1].firstChild.nodeValue;
trace(dat); // Displays the HTML file name
}
}

Now "dat" has the html file that I need to load in my TextArea...that's my problem...any ideas how to load it up?

tg
07-31-2007, 07:06 PM
when you say html file.... do you mean like 'myFile.html'??
if so, is your 'html' file a real html file as in:

<html><head></head><body><!-- some content--></body></html>


because if so, it will likely NOT display in the text field the way you want.

if your 'html' file is a text file with some stings with some minimal html tags in it like:

this is <b>MY</b> content.


then you can the to load the text from the file into a loadVars object the do:

myTextArea.htmlText=myLoadVarsObject.textstuffs;


you can do a search here on the load vars object and html tags allowed in text fields. it may help. also check thru the tutorials here. maybe something there also.

Joelito
08-02-2007, 03:03 PM
Ok....Thanks :)