Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-22-2006, 12:32 AM   #1
Registered User
winfreebot's Avatar
Join Date: Jan 2006
Posts: 97
Default Changing text size for dynamic text

Hey guys,

So I've got some dynamic text that I want to concatenate some text onto. Sometimes, however, I want to change the font size of that text. At the moment my code looks something like this but it doesn't work; even if "anotherCondition" is met, the text (unfortunately) does not change:

Any ideas? Thanks! (I'll post my actual code if needed, but it's a mess and will need some cleaning up for readbility...happy to do so though if preferred)

myTextFormat = new TextFormat();
myTextFormat.size = 10;
myTextFormat.bold = true;


    if (anotherCondition)
	myTextFormat.size = 14;

    accumulatingText.text += newText + newline;

winfreebot is offline   Reply With Quote
Old 02-22-2006, 03:22 AM   #2
Senior Member
Join Date: Jul 2005
Location: India
Posts: 1,029

place a text box names box_txt on stage and write this code at the first frame of the maintime line .. (the code is from the flash help)
PHP Code:
var format1_fmt:TextFormat = new TextFormat();
format1_fmt.font "Arial";
format2_fmt:TextFormat = new TextFormat();
format2_fmt.font "Courier";
string1:String "Sample string number one."+newline;
string2:String "Sample string number two."+newline;
box_txt.multiline true;
box_txt.wordWrap true;
box_txt.text string1;
firstIndex:Number box_txt.length;
box_txt.text += string2;
secondIndex:Number box_txt.length;

The Tutorial Hub
Sunny13 is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing text color and linking text sidask8r Simple Stuff (Newbies) 1 06-12-2005 08:08 AM
createTextField and text size fmdano ActionScript 2.0 7 06-02-2005 01:45 PM
changing text color by changing xml-text andreas_ad ActionScript 2.0 0 10-23-2004 10:42 PM
If anyone's bored, a custom class . . . retrotron ActionScript 1.0 (and below) 22 05-24-2003 10:01 PM
movie with text fields + changing that text. Clemens ActionScript 1.0 (and below) 7 07-11-2002 04:26 PM

All times are GMT. The time now is 04:40 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.