Html coding in textbox

hi everyone,

Can anyone tell me what the ‘html’ tag is in the text properties, i understand that it is a way to code html into the textbox and would like to know how does one do that…i.e. code html…

Umm, I believe in Flash 5 you check that HTML tag box and then give your textBox an instance name (i will use myTextBox)

myTextBox = "< B>This is bold text </ B>"

Remove the spaces between the bold tags of course. I am not sure if this works as I use MX and it works a tad bit differently in that aspect, but I think it should work.

The accepted tags are

< font>
< a>
< b>
< i>
< br>
< p>

without the spaces of course

You use them in exactly the same way as in html - and the rules of nested syntax and closing tags apply

don’t forget that if you use an embedded font with < b> and/or < i> then you need to include the bold, italic and/or bold-italic outlines as appropriate.

thanks for the help guys but after many unsuccessful attempts it has not worked…can you pls tell me the steps that i have to go through to attach the html coding…do i have to type the text in the actions panel if so then this should be in the key frame right…but when i type text in the keyframe then i don’t get it in a paragraph form or rather verse form which i would like…

thanks once again for the help

Ok, assuming you’ve created a dynamic text field on the main timeline called showText with the html box checked, if you declare the variable

showText="< a href=‘http://www.kirupaforum.com’>This is a link to Kirupaforum.</a>"

don’t put a space between the <b>"<"</B> and the <b>“a”</b> - I have to so they’ll show up in the forum

When you publish, you’ll have a link to this forum

Yes, and the text MUST be entered in actionscript to render as HTML.

cool thanks for the quick replies, i really enjoy posting on this forum coz the replies come in so fast…another question guys, I have made a separate mc, in which on different keyframes namely 1,2,3 i have made a dynamic textfield with different text in the different keyframes…the data in the text field in frame 1 is changed in frame 2 and so on in frame 3. I have targetted buttons to these various keyframes but the data does not change. I have labeled the keyframes too but to no effect. I used the tell target>gotoandStop() actions to stop at individual keyframes and no matter what button i click on I still get the information that is contained in keyframe1 when it should show information shown in keyframe 3 or 2…what am i doing wrong here…

Here is an easier way…

Try this… it only uses 1 frame.

On your frame add these action…

myText1 = "This is page 1";
myText2 = "This is page 2";
myText3 = "This is page 3";
myTextBox = myText1;

Then create your dynamic textBox and give it the var name “myTextBox” (without quotes).

Now make three buttons.

On button 1 add this…

on (release) {
	_root.myTextBox = _root.myText1;
}

On button 2 add this…

on (release) {
	_root.myTextBox = _root.myText2;
}

On button 3 add this…

on (release) {
	_root.myTextBox = _root.myText3;
}

Now test the movie and click each button.

I hope this helps!

lost, thanks for the help and the code. It worked fine :slight_smile: but can u pls tell me where i went wrong in the code that i had created as mentioned in my earlier post…will try seeing what i had done wrong myself but would appreciate some input from all you super flashers out there…also does scripting load faster than if i use a text box with information written inside it…

Can you post an example .fla of what you were trying to do before?

Yes, I believe loading text through AS or an external file does load faster than if you just put it in a text box. Not 100% sure, but I think it does.

But what if you have a lot of text to put in “myTextBox”?
how can you make a blank line, i tried /r/n but this didn’t work…

Andreas

To start a new line you can do this…

(not /n)

Or you can do it like this…

myText += "help 
";
myText += "I superglued 
";
myText += "Myself to 
";
myText += "Myself";
mybox.text = myText;

lost, can u tell me what the
does to the text, andersonm mentioned something about being able to put the text on a new line right, so why can’t we use < br > or < p > or does
do something else… pls let me know thanks…

If you HTML enable your text box you can simple add an HTML break tag like you demonstrated.

If you do not HTML enable your text box you can create a new line by using
. It is just a string manipulation thing I suppose.

Thanks for the quick reply lost… hope we can help each other out some other time.