5 Replies - 49982 Views - Last Post: 31 March 2010 - 01:36 AM

#1 chosen  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 24-July 06

font size in a dynamic text box

Post icon  Posted 28 October 2006 - 01:15 PM

Hi! Is there someone that can give me guidance to change the font size or the position of a letter in a dynamic text box.

For instance I am trying to display some chemical equations
this.createTextField("my_txt",this.getNextHightest Depth(),
260,150,215,150);
my_txt.text="H2O";


I want the 2 in H2O to be a different font size so it can look like a subscript. Any suggestions???

I have tried using <font size=-4>2</font> but it doesn't work. I guess I need to somehow figure out how I can point to a particular character to resize it. Hope this makes sense.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: font size in a dynamic text box

#2 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: font size in a dynamic text box

Posted 27 November 2006 - 07:08 AM

In a dynamic text box? Can't be done. Sorry.

Only option is to have each letter in a seperate text box
Was This Post Helpful? 0
  • +
  • -

#3 savil76  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-July 08

Re: font size in a dynamic text box

Posted 22 July 2008 - 03:45 PM

I want to share with you the way I get may subscript and superscript inin dynamic and input text field in Flash:
<sub> & <sup> tags are not supported by Flash :( but you can
use Subscript & Superscript in dynamic and input text field in Flash:

Download & install Subscript & Superscript fonts from http://www.subscriptfont.com or http://www.superscriptfont.com
You will need to restart Flash software after installed fonts.
Create a dynamic text field with Arial font embeded. Set the HTML property to true.
Create a dynamic text field with Subscript font embeded.
Create a dynamic text field with Superscript font embeded.
Use HTML tag to set text to subscript or superscript like below:
Some text<font face="Superscript\"></font>
If you are using ActionScript to test the htmlText, use script like below:
my_txt.htmlText = "Some text<font face='Superscript'>TM</font>";
Data can come from a XML file, TEXT file or from flash itself.
Was This Post Helpful? 0
  • +
  • -

#7 atherton01  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 1
  • Joined: 20-November 08

Re: font size in a dynamic text box

Posted 20 November 2008 - 12:26 AM

View PostpioSko, on 27 Nov, 2006 - 06:08 AM, said:

In a dynamic text box? Can't be done. Sorry.

Only option is to have each letter in a seperate text box


I don't know if this really helps you, but SetTextFormat allows you to specify only certain characters to receive the formatting from a TextFormat object.

So, you could make the "2" smaller with ActrionScript.

It's in the ActionScript 2.0 documentation. Here's a snippet:

// Create a TextFormat object.
var txt_fmt:TextFormat = new TextFormat();
// Specify paragraph and character formatting.
txt_fmt.bold = true;
txt_fmt.italic = true;
txt_fmt.size = 24;

// Sets the TextFormat object to apply only to the first three characters
myText_txt.setTextFormat(0, 3, txt_fmt);

You could use this approach to make the 2 smaller, however, it would just be smaller - it wouldn't subscript. The use of subscript and superscript fonts might give you better results.
Was This Post Helpful? 1

#8 Guest_golle3000*


Reputation:

Re: font size in a dynamic text box

Posted 29 March 2010 - 03:22 AM

it works like a fnord....

var tf:TextField = new TextField();
tf.htmlText = "<a href='event:myEvent'><font size='11' color='#0000FF'>click</font></a>";
tf.addEventListener("link", clickHandler);
addChild(tf);

function clickHandler(e:TextEvent):void {
trace(e.type); // link
trace(e.text); // myEvent
}


http://livedocs.adob.../TextEvent.html

bye golls
Was This Post Helpful? 0

#9 wwwroy99  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 31-March 10

Re: font size in a dynamic text box

Posted 31 March 2010 - 01:36 AM

hi
change the font style from actionscript and also import that font in your flash fla file
import your font in your library and use it by linkage ...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1