PDA

View Full Version : Getting text tool to properly display html?


NeoEnigma
03-12-2007, 05:04 AM
I've seen this on a few flash sites so Im quite sure its possible.

I want to be able to have some words show up bold, and others not. Some work as links.. you know what I mean. But I cant get it to work. Then again I dont know much of html so I guess that doesnt help.

Basically, if I have: I want this <B>thing</B> to work, i want "thing" to be bold and the rest not. Or is this not possible?

Mazoonist
03-12-2007, 06:11 AM
Use a dynamic text box.
Set it's html property to true, either using AS or in the properties inspector.
When giving it some text with AS, use the htmlText property instead of the text property.

Suppose you made a dynamic textbox called myText:

myText.html = true;
myText.htmlText = "Go to <a href='http://www.google.com'><b><u>Google</u></b></a>"
Note the use of the single quotes around the url. That's to distinguish it from the double quotes around the whole string.

NeoEnigma
03-12-2007, 09:35 AM
Sweet! That works great :) But now I'm running into another problem...

When I load the text into a text box, if the text requires more space than is provided by the box, it gets cut off (aka doesnt make the box bigger). This is a problem as I am planning to make this text box scrollabe (so if theres more, you simply move the movieclip containing the text box in order to see more). I have it masked so it fits where it needs to go.

Not sure how to get around this :\

Mazoonist
03-12-2007, 01:39 PM
Get into the help files. Look up the Textfield object. Study up on autosize and wordwrap. Should be everything you're looking for.

NeoEnigma
03-12-2007, 05:28 PM
again, thank you :) i really need to study up the help files a lot more. :)