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
font size in a dynamic text box
Page 1 of 15 Replies - 48197 Views - Last Post: 31 March 2010 - 01:36 AM
Replies To: font size in a dynamic text box
#2
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
Only option is to have each letter in a seperate text box
#3
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.
<sub> & <sup> tags are not supported by Flash
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.
#7
Re: font size in a dynamic text box
Posted 20 November 2008 - 12:26 AM
pioSko, 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
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.
#8 Guest_golle3000*
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
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
#9
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 ...
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 ...
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|