Be a Supporter!

Dynamic Text Problem

  • 346 Views
  • 11 Replies
New Topic Respond to this Topic
Musician
Musician
  • Member since: May. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Dynamic Text Problem 2005-07-23 04:37:42 Reply

I cant seem to find a way to use actionscript to change the size of the text in a dynamic text box. I looked through several of my actionscript books but all I found was this one piece of code that was something like "styler = new TextFeild". and then "setTextFormat(styler)" but this requires a with statement for styler including every variable that a text has when all I need to change is the size. So if anyone knows a better way please let me know.


I have no country to fight for; my country is the earth; I am a citizen of the world
-- Eugene Debs

Musician
Musician
  • Member since: May. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:16:48 Reply

seriously, why is it always so hard to find help around here.


I have no country to fight for; my country is the earth; I am a citizen of the world
-- Eugene Debs

Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:22:35 Reply

you can do htmlText instead of text ... instead of textbox.text = something do textbox.htmlText=something

and then you'll be able to use STYLING TAGS like

<span style='font:Arial;font-size:20px;'> TEXT HERE</span>

dELtaluca
dELtaluca
  • Member since: Apr. 16, 2004
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:28:14 Reply

only way to do that is using a textformat
for example lets say the dynamic textbox has an INSTANCE name of txt (not the VARIABLE name, that isnt important)

var tf:TextFormat = new TextFormat();
tf.size = 20;
txt.setTextFormat(tf);


using ShamelessPlug; NapePhysicsEngine.advertise();

BBS Signature
Musician
Musician
  • Member since: May. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:28:22 Reply

yah, funny thing tho, I never learned html even though I know Actionscript. so could you do a full script like how it would fit into the frame. Also I never knew you could do html in flash would there be any downsides?


I have no country to fight for; my country is the earth; I am a citizen of the world
-- Eugene Debs

dELtaluca
dELtaluca
  • Member since: Apr. 16, 2004
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:29:33 Reply

oh yeh, forgot about html text, i like to use textformats tho.


using ShamelessPlug; NapePhysicsEngine.advertise();

BBS Signature
Musician
Musician
  • Member since: May. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:30:52 Reply

k thanx guys, ill try that. one more question though, has anyone tried to do a video game collaboration yet?


I have no country to fight for; my country is the earth; I am a citizen of the world
-- Eugene Debs

Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:34:39 Reply

yes

Musician
Musician
  • Member since: May. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:38:41 Reply

At 7/23/05 05:28 AM, dELta_Luca wrote: only way to do that is using a textformat
for example lets say the dynamic textbox has an INSTANCE name of txt (not the VARIABLE name, that isnt important)

var tf:TextFormat = new TextFormat();
tf.size = 20;
txt.setTextFormat(tf);

wouldn't just be tf = new TextFormat;?


I have no country to fight for; my country is the earth; I am a citizen of the world
-- Eugene Debs

Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:41:08 Reply

nope, it's an empty constructor you need the ()

read my tutorial AS OOP if you REALLY care why

(as oop)

Musician
Musician
  • Member since: May. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Dynamic Text Problem 2005-07-23 05:57:39 Reply

oh whoops not I meant did it need the tf:TextFormat. or could the varialbe just be tf. I know I need parenthesis.


I have no country to fight for; my country is the earth; I am a citizen of the world
-- Eugene Debs

dELtaluca
dELtaluca
  • Member since: Apr. 16, 2004
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to Dynamic Text Problem 2005-07-23 07:02:34 Reply

yes the :TextFormat is not neccesary but it is good practice and has its benefits

its called strict data typing - something which is compulsory in languages like c and c++

http://livedocs.macr..p;file=00000780.html


using ShamelessPlug; NapePhysicsEngine.advertise();

BBS Signature