Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-22-2006, 12:32 AM   #1
winfreebot
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)

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

while(someCondition)
{

    if (anotherCondition)
    {
	myTextFormat.size = 14;
    }

    accumulatingText.setNewTextFormat(myTextFormat);
    accumulatingText.text += newText + newline;

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

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";
var 
format2_fmt:TextFormat = new TextFormat();
format2_fmt.font "Courier";
var 
string1:String "Sample string number one."+newline;
var 
string2:String "Sample string number two."+newline;
box_txt.multiline true;
box_txt.wordWrap true;
box_txt.text string1;
var 
firstIndex:Number box_txt.length;
box_txt.text += string2;
var 
secondIndex:Number box_txt.length;
box_txt.setTextFormat(0firstIndexformat1_fmt);
box_txt.setTextFormat(firstIndexsecondIndexformat2_fmt); 
__________________
SKS

The Tutorial Hub
Sunny13 is offline   Reply With Quote
Reply


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 11:37 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.