# HTML formatting in flash

**URL:** https://forum.kirupa.com/t/html-formatting-in-flash/4910
**Category:** flash
**Created:** [August 24, 2002, 12:51pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910 "2002-08-24T12:51:55Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![vip3r](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@vip3r](https://forum.kirupa.com/u/vip3r)
#### Post date: [August 24, 2002, 12:51pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/1 "2002-08-24T12:51:55Z")

</div>

I selected render text as html in flash, but it won’t work. whenever i put in ‘\<b\> This is my bold text \</b\>’ it doesn’t work, it actually displays the html. any ideas on getting this to work??? it won’t display my html, but u get the idea

---

<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: [August 24, 2002, 12:53pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/2 "2002-08-24T12:53:38Z")

</div>

oops, wrong forum. how do i move it?

---

<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: [August 24, 2002, 3:31pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/3 "2002-08-24T15:31:47Z")

</div>

```auto

_root.myTextbox.html = true
_root.myTextbox.htmlText = "<B>this text is bold</B>"

```

The first line tells the textbox to accept HTML code. The second line tells the textbox that the text inside is htmlText, not just text, so it should convert the tags. If you are using the standard verdana font, I have noticed that the bold tag doesn’t show up unless your font size is at 11 or higher, but you can experiment.

I hope this helps:)

\<B\>EDIT: Only Kirupa can move the threads\</B\>

---

<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: [August 24, 2002, 4:39pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/4 "2002-08-24T16:39:13Z")

</div>

that doesn’t seem to work… it makes my text _really_ small…  
i used the following html code, but it seemed to change it by adding like unnecessary slashes and stuff  
\<p\>\<font size=“1” face=“Arial”\>\<b\>News\</b\>\</font\>\</p\>  
\<p\>\<font size=“1” face=“Arial”\> \<b\>8/30/02\</b\>\</font\>\</p\>  
\<p\>\<font size=“1” face=“Arial”\>The site is finally done and up and running! I  
spent like a month searching for a good free host, and Portland definetly gives  
that to me. If you have any suggestions, my email is [ravi@vip3r.com](mailto:ravi@vip3r.com) \</font\>\</p\>

---

<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: [August 24, 2002, 4:40pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/5 "2002-08-24T16:40:10Z")

</div>

its supposed to be small as in that post in there, but flash makes is so u can’t even read it, its just a bunch of lines.  
\<p\>\<font size=“1” face=“Arial”\>\<b\>News\</b\>\</font\>\</p\>  
\<p\>\<font size=“1” face=“Arial”\> \<b\>8/30/02\</b\>\</font\>\</p\>  
\<p\>\<font size=“1” face=“Arial”\>The site is finally done and up and running! I  
spent like a month searching for a good free host, and Portland definetly gives  
that to me. If you have any suggestions, my email is [ravi@vip3r.com](mailto:ravi@vip3r.com) \</font\>\</p\>

```php
<p><font size="1" face="Arial"><b>News</b></font></p>

```

---

<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: [August 24, 2002, 4:40pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/6 "2002-08-24T16:40:51Z")

</div>

and for some reason, my whole code block won’t show up 🙂

---

<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: [August 24, 2002, 4:41pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/7 "2002-08-24T16:41:58Z")

</div>

```php
<p><font size="1" face="Arial"><b>News</b></font></p>
<p><font size="1" face="Arial"> <b>8/30/02</b></font></p>
<p><font size="1" face="Arial">The site is finally done and up and running! I 
  spent like a month searching for a good free host, and Portland definetly gives 
  that to me. If you have any suggestions, my email is [email]ravi@vip3r.com[/email] </font></p>

```

---

<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: [August 24, 2002, 4:44pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/8 "2002-08-24T16:44:03Z")

</div>

Define your font in your dynamic textbox, not in HTML. That way you don’t have to keep retyping it. The spot to choose your font is the same spot to type in the variable name of your textbox.

That is an easier way, but if you want to do font size, I believe it is specified as +1 not 1. I use specified px font sizes, so I am not sure how the whole + system works with the fonts, it never gave me the effect I wanted, so I never used it.

Hope this 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: [August 24, 2002, 4:52pm UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/9 "2002-08-24T16:52:18Z")

</div>

ok, now it works, but the line spacing is incredibly big and some of the text is missing 🙂  
my fla is at [http://www.vip3r.com/temp/navigator.fla](http://www.vip3r.com/temp/navigator.fla) if u wanna take a look

---

<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: [August 27, 2002, 4:48am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/10 "2002-08-27T04:48:18Z")

</div>

Wow, sorry I disappeared here for a few days. I tried downloading your file and I got an error while trying to open it.

What I suggest doing to fix your problem is… select your text box, click on the button in the properties that says FORMAT. Then change the option for Line Spacing.

I hope this helps ya:)

---

<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: [August 27, 2002, 5:41am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/11 "2002-08-27T05:41:50Z")

</div>

lostinbeta… does that work with 5.0 or only MX?? It’s important to note that in here as this is an action script forum for both versions… personaly I’d love to be able to use that technique myself… but still using Flash 5.0 the question begs to be asked.

---

<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: [August 27, 2002, 5:52am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/12 "2002-08-27T05:52:49Z")

</div>

I actually took this up with a buddy of mine before. It is possible in Flash 5. Since I don’t use Flash 5 and he does, I worked it out with him (he is a newbie at Flash).

Ok, for Flash 5…  
Draw your Textbox and give it the variable “htmlTextBox” (without quotes). Check the checkbox that says HTML. Make it dynamic text of course also. Anything else is up to you.

Inside the FRAME actions panel add this…

```php

_root.htmlTextBox = "<B>This is bold</B> <I>italics</I>"

```

Then preview movie. It should show the HTML formatted text. For some reason it will not format the html if you type it directly into the text box. It needs to be added through actionscript for this to work.

I hope this helps you out david.

---

<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: [August 27, 2002, 6:02am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/13 "2002-08-27T06:02:11Z")

</div>

ok… that’s not exactly what I meant… but I think I misinterpreted what you were doing there.

You are correct that this method only works if you add the text into the field as a variable string, and not if you type it directly into the box. I thought that you were setting the format of the box itself, which now that I read back through the post I see that is not what you are doing.

I don’t know what I was thinking. 🙂

---

<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: [August 27, 2002, 6:07am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/14 "2002-08-27T06:07:59Z")

</div>

Oh, I thought it was weird that you of all people didn’t know how to do that.

You can set the format of the box itself, but that I only know how to do in MX. It looks something like this if you are dynamically creating your textbox

```auto

_root.createTextField("click", 2, 180, 3, 187, 17);
_root.click.selectable = false;
_root.click.border = true;
myformat = new TextFormat();
myformat.font = "Verdana";
myformat.size = 10;
myformat.color = 0x000000;
_root.click.text = "Click And Drag the Solid Squares";
_root.click.setTextFormat(myformat);

```

I took this code from this thing I did in MX, so if it makes no sense, sorry.

---

<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: [August 27, 2002, 6:11am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/15 "2002-08-27T06:11:49Z")

</div>

sweet… I can’t wait to get MX. 🙂

---

<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: [August 27, 2002, 6:13am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/16 "2002-08-27T06:13:16Z")

</div>

I love. I used Flash 5 in school and it is horrid compared to MX! Although I am not knocking 5, I did enjoy messing with it in school, but now that I am used to MX, I could never go back to that.

I actually never learned actionscript on Flash 5. Never had time to. Always had to do my work ☹

---

<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: [August 27, 2002, 6:22am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/17 "2002-08-27T06:22:41Z")

</div>

do you have two monitors? I found during trial that MX really needs the second monitor to be able to be used efficiently…

---

<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: [August 27, 2002, 6:24am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/18 "2002-08-27T06:24:40Z")

</div>

Nope, only one tiny 800x600 monitor here. How is it used effeciently with 2 monitors?

I have all my panels as floating windows and I closed them so only the timeline and properties panels are “attached” so I can minimize and maximize those as needed. Anything else I just close up and call back with hotkeys when I need them (such as the action window, just use F2 to recall it after you close it). Works like a charm.🙂

---

<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: [August 27, 2002, 6:31am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/19 "2002-08-27T06:31:34Z")

</div>

With a second vid card and monitor (pci vid card that is) you can have both monitors connected, virtually, so that when you move the cursor, off one side of your screen it apears on the other monitor and visversa. So you can throw all the panels on one, and work in the other.

Jesus… I don’t know how you get anything done in that small an environment. I have my monitor set to 1276 by something… real small anyway, and sometimes I have problems using Flash 5.0 in that amount of space.

Well… when I get my second monitor set up I’ll be sure to take some pics for you to see how I set up the panels. 🙂

---

<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: [August 27, 2002, 6:34am UTC](https://forum.kirupa.com/t/html-formatting-in-flash/4910/20 "2002-08-27T06:34:08Z")

</div>

THAT IS AWESOME! I hate having such a small monitor, but I am poor, so there is nothing I can do about that right now:)

I might try that double monitor thing when I get some money in my pocket. That sounds very interesting. If not the double monitor thing, I am definitely buying a bigger monitor. This one drives me nuts!
