HTML formatting in flash

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

oops, wrong forum. how do i move it?


_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>

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 [email protected] </font></p>

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 [email protected] </font></p>

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

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

<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][email protected][/email] </font></p>

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:)

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

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:)

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.

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…


_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.

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. :slight_smile:

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


_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.

sweet… I can’t wait to get MX. :slight_smile:

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 :frowning:

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

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.:slight_smile:

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. :slight_smile:

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!