# HTML in DynamicTextBox

**URL:** <https://forum.kirupa.com/t/html-in-dynamictextbox/12112>\
**Category:** flash\
**Created:** [January 27, 2003, 4:00am UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112 "2003-01-27T04:00:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaztank](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Gaztank](https://forum.kirupa.com/u/Gaztank)\
**Post date:** [January 27, 2003, 4:00am UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/1 "2003-01-27T04:00:25Z")

</div>

I’ve got a dynamic textbox loads a .txt file with HTML code in it. The problem is that it only loads simple things (ie. plain text, the \< B \>, \< BR \>, \< U \>, \< I \> tag etc.) but it doesn’t seem to like \< table \> or lists etc. … is there anyway of getting around this?

If anyone wants to see this in action, check out my website and go to my resume.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 4:23am UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/2 "2003-01-27T04:23:47Z")

</div>

Only html formatting tags are supported.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 10:42pm UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/3 "2003-01-27T22:42:29Z")

</div>

Hi!  
I have a similar HTML-Problem with Flash.  
[Macromedia support](http://www.macromedia.com/support/flash/ts/documents/htmltext.htm) says Flash can read “a href” tags.

We tried the example shown on the page, but  
nothing is being displayed in our textbox:\*(

Does anyone have a clue what we are doing wrong…?

Thanks a lot for your help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 10:47pm UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/4 "2003-01-27T22:47:53Z")

</div>

Oh yeah they do work, oh sorry i didn’t mention so!

You should enable html in your textfield:

myTextBox.html = true

myTextBox.htmlText= somevariable;

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 11:01pm UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/5 "2003-01-27T23:01:28Z")

</div>

Thanks a lot, but my problem is that in my case, I am loading an external .txt file into flash.  
Does it make a difference to flash wether the text is being loaded or typed directly into the  
textbox???

In my case, flash just doesn’t display the link and also nothing below the textline with the link in it.

Do you have an idea how I could save that problem?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 11:16pm UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/6 "2003-01-27T23:16:41Z")

</div>

I think the best thing is to attach an example…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 11:21pm UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/7 "2003-01-27T23:21:03Z")

</div>

\<space\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 11:33pm UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/8 "2003-01-27T23:33:52Z")

</div>

## I load a file into flash with the following actionscript:

## lowlimit = 0;highlimit = 500;loadVariables(“news.php?lowlimit=”+lowlimit+"&highlimit="+highlimit, \_root); stop();

## The news.php generates the text from a .txt file which is entered like that:

## a href=“[http://www.yahoo.com](http://www.yahoo.com)”\>Testlink\</a (I didn’t write all the brackets cause it would then only display the link text for you)

## but flash doesn’t display the link :sleep: That’s what the part of the php which loads the text looks like:

```
		$fp=@fopen("guestbook.txt","r");
		@flock ($fp,2);
		$garr=array();
		while ($line=@fgets($fp,1024)){
			array_push($garr,$line);
		}
		$totalent=count($garr)-1;
		if ($totalent&lt;0){
			$totalent=0;
		}
		if($highlimit&gt;$totalent){
			$highlimit=$totalent;
		}
		print "&txtll=$lowlimit&txthl=$highlimit&totalentries=$totalent&txtmain=" ;
		if (count($garr)==0){
			print "&lt;br&gt;&lt;br&gt;&lt;b&gt; :::: Nothing to display :::: &lt;/b&gt;";
			exit();
		}
		$ar=array_reverse($garr);
		$garr=array();
		for($i=$lowlimit;$i&lt;=$highlimit;$i++){
			
				if (!$ar[$i]) {
						print "&lt;br&gt;&lt;br&gt;&lt;b&gt;::: Nothing Below This :::&lt;/b&gt;";
						exit;
				}
				print $ar[$i];
				print "&lt;br&gt;&lt;br&gt;";
		}
		@flock($fp,3);
		@fclose($fp);

```

hope that helps(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 11:54pm UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/9 "2003-01-27T23:54:09Z")

</div>

oh… thanks for your file…

I think one of the main issues is that you  
load the link (as it seems to me :beam: ) as  
a variable whereas I load it as text…

Yawn… :sleep: I think I have to look into  
it 2morrow =)

Thanks a lot for your help

Take care  
CU

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 28, 2003, 12:09am UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/10 "2003-01-28T00:09:00Z")

</div>

> \*Originally posted by h88 \*  
> \*\*Only html formatting tags are supported. \*\*

what’s meant by the above statement?

but either way, u just wanna say it just won’t support \< table \> etc. ??

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 28, 2003, 12:13am UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/11 "2003-01-28T00:13:11Z")

</div>

> \*Originally posted by Gaztank \*  
> \*\*what’s meant by the above statement?

but either way, u just wanna say it just won’t support \< table \> etc. ?? \*\*

Yup. ☹  
[http://www.macromedia.com/support/flash/ts/documents/htmltext.htm](http://www.macromedia.com/support/flash/ts/documents/htmltext.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 28, 2003, 12:23am UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/12 "2003-01-28T00:23:21Z")

</div>

aww … that kinda sux … hmm … this’ll probably make my page look kinda weird, now that i have to that stuff into PDF format … hehehe

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 28, 2003, 1:00am UTC](https://forum.kirupa.com/t/html-in-dynamictextbox/12112/13 "2003-01-28T01:00:24Z")

</div>

> whereas I load it as text…

Oh lol so your trying to load it all as a text…?

Text file content is:

textblahblabla

No variable…?

Yeah it can be done!

Here:

```php
myLoadVars = new LoadVars();
myLoadVars.onLoad = function(success) {
	if (success) {
		texti = unescape(this);
		myTextBox.html = true;
		myTextBox.htmlText = texti.substring(0, texti.lastIndexOf("&"));
	} else {
		trace("Error Loading file...");
	}
};
myLoadVars.load("textfile.txt");

```
