Skip to main content
Participating Frequently
February 23, 2021
Answered

Is it possible to give a text a colored background and certain distances?

Hi,

 

is it possible to give a text a colored background and certain distances?

Best regards,

René

 

 

This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
February 23, 2021

you can control somethings with the properties panel, but not nearly as much as you can control with code.

 

for a dynamic textfield with instance name tf, use:

 

var tfor:TextFormat = new TextFormat();
tfor.blockIndent = 40;
tfor.color = 0x46C944;

 

tf.width = 120;
tf.height = 50;
tf.background = true;
tf.backgroundColor = 0x000000;
tf.text = "Lorem Ipsum";
tf.setTextFormat(tfor);

3 replies

kglad
Community Expert
Community Expert
February 23, 2021

yes.

 

html5 or actionscript?

Translate
reneAdobeAuthor
Participating Frequently
February 23, 2021

actionscript. 

about properties it is not possible?

Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
February 23, 2021

you can control somethings with the properties panel, but not nearly as much as you can control with code.

 

for a dynamic textfield with instance name tf, use:

 

var tfor:TextFormat = new TextFormat();
tfor.blockIndent = 40;
tfor.color = 0x46C944;

 

tf.width = 120;
tf.height = 50;
tf.background = true;
tf.backgroundColor = 0x000000;
tf.text = "Lorem Ipsum";
tf.setTextFormat(tfor);

Translate