Skip to main content
Known Participant
May 4, 2011
Question

as3 htmlText problem

  • May 4, 2011
  • 2 replies
  • 4629 views

I have a dynamic text box for 3 lines of text. I styled part of the text to be bold and part of it to be regular. When i click on the button to display the text it looks right the first time but if i click on it a second time then all of the text shows up bold instead of just the few lines i assigned the bold tag to. Has anyone else had this issue?

This topic has been closed for replies.

2 replies

JimondoAuthor
Known Participant
May 5, 2011

couldn't figure out how to make everything work with the current code so i changed my set up so that i have a regular text box with each state info in a different key frame and then on each state_btn i put a go to frame and stop action. Not sure if this is the proper or best way to do this but it is working so far- hopefully my file size won't be too large.

kglad
Community Expert
Community Expert
May 5, 2011

if your code is working, leave it.

JimondoAuthor
Known Participant
May 5, 2011

it works fine as far as when i click on the state button the correct information shows up but i can't figure out / understand AS3 to customize the text to look like i want

kglad
Community Expert
Community Expert
May 5, 2011

copy and paste the relevant (only) code.

JimondoAuthor
Known Participant
May 5, 2011

I have the dynamic box properties set to Arial regular and then i'm adding the bold tag in actionscript window to the name and number. It looks fine the first time the button is clicked but second time it bolds everything. I am new to flash so no idea what i'm doing wrong ...

var alabama_btnInfo = "<b>John Smith<br>(555) 123-4567</b><br><font size=10>Northern Alabama</font><p>Mary Smith<br>(555) 123-4567<br>Southern Alabama</p>";

I am also having problems figuring out the leading. I would like there to be extra spacing between Northern Alabama text and Mary Smith text. I tried doing that in the properties window for the text box (since i dont know the code to do it myself) but it adds the same spacing for line breaks and paragraph breaks

kglad
Community Expert
Community Expert
May 5, 2011

1.   you need to embed both fonts.

2.  the code you showed doesn't match the image you showed.

3.  show a typical state click listener and listener function where you assign your htmlText.