Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding text to HTML field with actionscript

Status
Not open for further replies.

jefargrafx

Instructor
May 24, 2001
273
US
okay,

maybe I just don't know the syntax...but I got a dyanmanic text field name "fred"

and another dyamanic text field with a calcualted value, name "burt"

when the frame starts daysold = "365"

fred is an html text box and
I want fred to = &quot;<b>hi I'm &quot; + daysold + &quot;days old</b>&quot;

this don't work,

if fred is NOT an html text box...works fine.

why?

the paln is to change part of the result, font color, size with HTML?

any ideas?

thanks

jef
 
Flash 5 or MX?

Works for me! Have you checked the html tab? Regards,

oldman3.gif
 
sorry Flash 5

what HTML tab...do you mean the html check box on the text option panel?

in flash 5

fred = &quot;<b>html text </b> + daysold + &quot;<b>days old</b>&quot;

or are you using MX?

let me know

thanks jef
 
oh, I guess you should know that daysold is not an html text field.

I get that &quot;number&quot; from a calulation

let me know jef
 
Although I now am mostly on MX, did check your stuff on 5.
Worked as a charm! Piece of cake!
Yes, the html tab in the text options panel! Regards,

oldman3.gif
 
oldnewbie....
okay maybe I'm the one getting old? (smile)

here's my code...why dosn't this work?

stop ();
this.sal_com_resultsTXT01MC.BG = &quot;<b>To make an additaional &quot;+_parent.sala_yearIncomeMC.result+&quot; dollars you would have to work an&quot;+&quot;<FONT FACE=\&quot;Arial\&quot; SIZE=\&quot;24\&quot; COLOR=\&quot;#00FF33\&quot;><B> extra </B>&quot;+this.extrahoursMC.result+&quot; hours, or an extra &quot;+this.extraweeksMC.result+&quot; weeks to match the the amount of income that you would generate with your own business.</b>&quot;;


the field renders all the way up to the point I want to increase the size and color of the word &quot;extra&quot;

then nothing?

any idea?

thanks jef
 

my_var1 = &quot;$500.00&quot;;
my_var2 = 50;
my_var3 = 3;
test=&quot;<b>To make an additional &quot;+my_var1+&quot; dollars you would have to work an <FONT FACE=\&quot;Arial\&quot; SIZE=\&quot;24\&quot; COLOR=\&quot;#00FF33\&quot;> extra <FONT FACE=\&quot;Arial\&quot; SIZE=\&quot;16\&quot; COLOR=\&quot;#FF0000\&quot;>&quot;+my_var2+&quot; hours, or an extra &quot;+my_var3+&quot; weeks to match the amount of income that you would generate with your own business.</b>&quot;;

dollars you would have to work an&quot;+&quot;<FONT FACE=\&quot;Arial\&quot; SIZE=\&quot;24\&quot; COLOR=\&quot;#00FF33\&quot;><B> extra </B>&quot;+this.extrahoursMC.result+&quot; hours, or an extra...

Changed to my variables, did remove the &quot;+&quot; in -> ...to work an&quot;+&quot;<FONT FACE... because it was useless, and the bold tags for extra, since all your string is already set to bold at the beginning of it, but none of that made any difference anyway!

You must have something else wrong somewhere!

Your sure, you have the html tab selected and also Multiline and Word wrap? Regards,

oldman3.gif
 
holy holy holy...

I just took your code and placed on may variable and got the same problem.

yes, I'm sure the field is set to HTML

if I place your code in a new file it works fine?

here is a link to download my fla, if you wouldn't mine, look over my shoulder and let me know what your think?


it's rather complicated, but run it, enter a minium PV and select salary comparison to see the problem.

thanks jef
 
okay, I got it figured out.

formating was correct, however, I had the embed font selected on the text field panel.

looks like your can do this with HTML formating the text.

thanks so much for your help.

jef
 
If you don't mind, I'll take your word for it!

Glad to have been of some help! Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top