How To Code Font Size In External Text File?
I am using some external text within a website. I have found that if I type the text in a text program and save it as Unicode 8 format, it doesn't seem to need breaks or paragraph coding. That is the first confusing thing. Secondly, I can't get it to change the font size, although it will change colour, add italics, bold, etc. When I try to put the font size attribute in, the text doesn't show up in flash. Can someone help with this?Currently, my text is like this. I'd like to add a bigger size to the title.content=<b>subtitle</b><font color="#ff3333">title</font></b> <b>subhead</b>textMany thanks!
Adobe > Flash General Discussion
Posted on: 12/15/2006 08:48:15 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Button Visibility Depending On Size Of External Text File
I have a text field in an external movie into which i am loading external text files using a load vars object in the master movie. I have 2 scrollbuttons that i want to appear when the amount of text in the file exceeds the amount of text that can be displayed in the text field.
If anyone has any suggestions I'd appreciate it.
The AS i've been playing with is below - i cant seem to get it to work but as i dont have that much experiance there's probably something really obvious i'm doing wrong.
//scroll btns visibility//////////////////////////////////////////
//max number of characters that fit in loadedInfo text field
var maxText:Number = 715;
var textCount:LoadVars = new LoadVars ();
//load variables from file that contains number of characters in text file to be loaded into loadedInfo text field
textCount.load("text/meCharacters.txt");
//proced only if variable has been loaded correctly
textCount.onLoad = function(success){
if (success){
trace (textCount)
btnVisibility();
}else{
this.loadedInfo.text = "error";
}
}
trace (textCount)
//controll visibility with variables
function btnVisibility (){
if (maxText > textCount){
this.UpBtn._visible = false;
this.DnBtn._visible = false;
} else {
this.UpBtn._visible = true;
this.DnBtn._visible = true;
}
}
Code For Preloading An External Text File
I have a movie that loads news entries from a text file. All I wanna know is the code to on how to make it play a preloader clip while it is downloading the text file and where to put these codes, etc.
Please thanks..
Can I Use Pixel As Font Size Code In Flash
i did this scroller
http://www.actionscripts.org/tutoria...II/index.shtml
for font sizes i used 10px for instance. it works fine for me but when viewed on a Windows machine it doesn't seem to work. also the windows machine doesn't recognize the bold tags, weird
How Can I Change The Font Size Of List Compenent By The Code?
hello,everybody,
i just start studying as3 thest days. i use component not often is AS2. so when i use AS3 compenent , i ' m not use it fluently.
pls help,how can i change the font size of List component by the code in AS3? or by the UI.thanks~~~
Font Affecting File Size
I have used 2 fonts in my website so far...not the plainest but not the most 'fancy' either. (SuessFont and Harrington for anyone who cares!) I was checking out the Bandwidth profiler while testing my movie and I started playing around with the font and font size in my dynamic text box in the preloader scene. Frame 1 (which has a dynamic text box and some actionscript, nothing else) was 5K using SuessFont and 11K using Harrington, both the fonts I have used consistently (and exclusively) throughout the project. But when I change that font to anything else (and I tried some really detailed ones, with picture-letters!), the bandwidth profiler shows the size of Frame 1 dropping down to between 280 and 300 bytes. What is the deal? Any suggestions, anyone???
Changing Font Color/size For An XML File Displayed In A Browser
Hello I have an XML file that is displayed in a browser..
I want to be able to format the text (change the font color and size)
as well as change the background to a color or image.
I have had some luck in the past linking the xml file to a CSS
using the following code at the top of the XML file:
----------------------------------------------------------
<?xml-stylesheet type="text/css" href="cssforxmlfile.css"?>
----------------------------------------------------------
But for the XML file that I am working on I can't seem to get it to work (And
I cant change the layout of the XML file).
I want to be able to change the font type, size and color of all the text
in " " that follows str=
I have bolded the first few chunks of text that I want to be able to format.
Does anyone know how I can do this??
-----------------------------------------------------------------
<?xml version="1.0" encoding="unicode" ?>
<?xml-stylesheet type="text/css" href="estyleb.css"?>
<TerminalParams>
<Images>
<ImageDetails id="1" filename="DresserWayne_EK3_Banner.gif" width="640" height="120"/>
</Images>
<BackgroundImages>
<ImageInstance imageId="1" left="0" top="0"/>
</BackgroundImages>
<Prompts>
<Prompt id="0" str="Please insert your membership card" left="0" top="180" width="640" height="72"/>
<Prompt id="1" str="Would you like to pay with this card? Please press YES or NO" left="0" top="180" width="640" height="72"/>
<Prompt id="2" str="Please insert your membership card, credit card, or shopping card" left="0" top="180" width="640" height="72"/>
<Prompt id="3" str="Please Lift Nozzle"/>
<Prompt id="4" str="Select grade"/>
<Prompt id="5" str="Begin Fueling"/>
<Prompt id="6" str="Please Replace Nozzle After Fueling"/>
<Prompt id="7" str="Would you like a receipt? Please press YES or NO "/>
<Prompt id="8" str="Your receipt is printing..."/>
<Prompt id="9" str="Please take your receipt"/>
<Prompt id="10" str="Sale Completed Thank You "/>
<Prompt id="11" str="One Moment Please..."/>
<Prompt id="12" str="Please remove your card"/>
<Prompt id="13" str="Please re-insert your card "/>
<Prompt id="14" str="Card Read Error Please try again"/>
<Prompt id="15" str="Your membership has expired. Would you like to renew it for % ?"/>
<Prompt id="16" str="Member Inactive Please Renew"/>
<Prompt id="17" str="Card is invalid"/>
<Prompt id="18" str="CANCELING... Please wait..."/>
<Prompt id="19" str="Are you a member? Please press YES or NO "/>
<Prompt id="20" str="Press Credit, Debit or Shopping Card"/>
<Prompt id="21" str="Insert Credit Card"/>
<Prompt id="22" str="Insert Debit Card"/>
<Prompt id="23" str="Insert Shopping Card"/>
<Prompt id="24" str="Membership card is not recognized"/>
<Prompt id="25" str="Card is not acceptable"/>
<Prompt id="26" str="%"/>
<Prompt id="27" str="Card Balance $%"/>
<Prompt id="28" str="Your discount is $%
Shopping Card Balance is $%"/>
<Prompt id="29" str="Would you like a car wash? Please press YES or NO "/>
<Prompt id="30" str="Please select carwash"/>
<Prompt id="31" str="We're Sorry, We Are Presently Closed
OPEN: M-S 6am-9pm
SUNDAY 9am-7pm"/>
<Prompt id="32" str="Sorry, carwash not available"/>
<Prompt id="33" str="Your discount is $%"/>
<Prompt id="34" str="Card is expired
TRANSACTION CANCELED"/>
<Prompt id="35" str="Replace nozzle to complete sale"/>
<Prompt id="36" str="Please replace nozzle"/>
<Prompt id="37" str="Dispenser is Offline"/>
<Prompt id="38" str="Pump authorization failed. Sale cancelled."/>
<Prompt id="39" str="Is this a Debit card? Please press YES or NO"/>
<Prompt id="40" str="Credit or Debit?"/>
<Prompt id="41" str="Please insert your membership card" left="0" top="180" width="640" height="72"/>
<Prompt id="42" str="Please insert your payment" left="0" top="180" width="640" height="72"/>
<Prompt id="43" str="Receipt Printer is out of paper. Continue?"/>
</Prompts>
</TerminalParams>
-----------------------------------------------------------------
Here is the code that I have in my CSS file:
-------------------------
Prompts
{
color: #ff7f00;
font-size: 12pt;
}
-------------------------
As you can see I have tried to change the font color and size of
the text for "Prompts" but it doesn't seem to work.
Have I done something wrong???
Or is there another way to format the text?? either with an external file
or within the XML file?
Thanks, Andrew
Changing Font And Size Of Text Added To Dynamically Created Text Fields
Whew.. That long-winded subject line pretty much covers it.
Link
In the galleries, I have text I am adding to a movieClip. I have been able to add the description text, change it's colour, but the font and size are not responding. I'm using FlashMX2004. Can anyone show me what I'm doing wrong? Here's the pertinent code:
_parent.Gallery.createTextField(["Txt_" + CVar], _parent.LevelCount + 1000, 175, _parent.EntryY, 325, 110);
_parent.Gallery["Txt_" + CVar].font = "Arial";
_parent.Gallery["Txt_" + CVar].text = _parent.Description[AVar];
_parent.Gallery["Txt_" + CVar].textColor = 0xFFFFFF;
_parent.Gallery["Txt_" + CVar].textSize = 25;
Thanks so much!
Controlling The Size And Font Of Text Within A Dynamic Text Box While Importing Txt
I am trying to control the size and font of text that my SWF file loads from an external .txt file. The import works and it displays text, but the size of the font is ALWAYS as huge as the defined text box region I made in flash.
Working with Flash 5 on a PC (details).
Can anyone tell me how to tell flash the desired font size and/or font type when importing from a txt file during the movie?
Thanks much
Dahmer
Change Font Size To Fit Dynamic Text Box Rather That AutoSize Text Box
Hey guys,
First post, I searched and couldn't find an answer to this question, I don't think this has been discussed but if it has I'm sorry.
All the threads I have seen are using autoSize to resize the text field around the text. What I would like to do is lower the font size of the dynamic text to fit the text into the dynamic text field. Is that possible? I saw a thread where they scale a movie clip to fit in an area but isn't what i want to do because it will cause more problems than it fixes.
Thanks in advance.
Re-Size Font To Fit Text Box
Hello all...
I would like my text to automatically re-size to fit a dynamic text box.
A quick search found this code:
Code:
// Function to resize the text in a text field so that it fills up the maximum space available
function fixTextSize(textfield, maxheight) {
textfield.autoSize = true;
thistextsize = 10; // Start at 10pt size
thisheight = thistext.textHeight; // Get current height
myTextFormat = new TextFormat(); // Instance of TextFormat object required
// Loop until height exceeds limit, font getting bigger each time
while (thisheight < maxheight) {
thistextsize++;
myTextFormat.size = thistextsize;
textfield.setTextFormat(myTextFormat);
thisheight = thistext.textHeight;
}
// Reduce size by 1 as we have exceeded limits
thistextsize--;
myTextFormat.size = thistextsize;
textfield.setTextFormat(myTextFormat);
}
It was posted on this forum and looks absolutely perfect for what I am trying to achieve.
However, when I use it, rather than resizing the font it simply makes the text box bigger.
Does anybody know where I might be going wrong? Or perhaps another way or resizing text?
I've tried embedding the font but when I did this the text did not appear at all.
Thanks in advance for any help - and I hope the original poster of the script doesn't mind me re-printing here,
David
Font Size In Text.
I know this might be easy but has me baffled.. I made a scoll window with all links . font size I want to show is 12 how would I go about that?
here is my A code
onClipEvent (load) {
this.loadVariables("text.txt");
}
onClipEvent (data) {
text = txt;
}
This is my Text.doc
title=Link&txt=<font color="#0000gg"><ahref="http://www.blahblah.com"target="_blank"><u>me1</u></a></font><br>
how can I make text (ME1) to a size 12
I have tryed normal html code wont work Any one?
Many thanks
Regards Barrie
Font Size In Text.
I know this might be easy but has me baffled.. I made a scoll window with all links . font size I want to show is 12 how would I go about that?
here is my A code
onClipEvent (load) {
this.loadVariables("text.txt");
}
onClipEvent (data) {
text = txt;
}
This is my Text.doc
title=Link&txt=<font color="#0000gg"><ahref="http://www.blahblah.com"target="_blank"><u>me1</u></a></font><br>
how can I make text (ME1) to a size 12
I have tryed normal html code wont work Any one?
Many thanks
Regards Barrie
Text Scrollers With Font Size
I have a text scroller that won't let me change the font size.
It looks like I change the size and make it bold while editing, then when I test it (or publish it) the entire thing becomes the size of the title (the changed text). I've tried using two fonts, and it does the same thing.
Is this normal?
The font is Harmony from Fonts For Flash (one of the free ones)
Thanks.
Text And Font Size Using The Scrollbar?
Can anyone help me please. I can't seem to be able to find out how to manipulate the text and fonts when I'm using the dynamic textbox and scrollbar. Any suggestions. You can see what I've created at:
www.joeyberkley.com I would like to be able to highlight all of the textboxes in this site. I had previously used another textbox method but commas and other characters would mess it up. (But I could use html tags to highlight stuff.
thanx in advance for any help.
Cobyco
Font Size In A Dynamic Text Box
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
Dynamic Text Font Size
I have a Dynamic text box and would like to change the font size using AS.
My textbox has an instance name of "eggs". (Should that really be eggs_txt?)
I have managed to find a few examples of code which doesn't work.
var eggs:TextFormat = new TextFormat();
eggs.size = 20;
eggs.setTextFormat(eggs);
Any help for a Flash noob?
Graham.
Dynamic Text Font Size
Why do the dynamic text font size appears smaller than what I specified in the flash dynamic text properties?
I used a font size of 50 for the dynamic text and when I test movie, it appears to be only a font size of 12. Why is it so?
Dynamic Text Font Size
Why do the dynamic text font size appears smaller than what I specified in the flash dynamic text properties?
I used a font size of 50 for the dynamic text and when I test movie, it appears to be only a font size of 12. Why is it so?
Does Code Add To File Size?
I was always under the impression that ActionScript code adds negligible amounts to the swf file size. Now I have a file with more code than I've ever had in any other movie (778 lines). The swf file size is at 73K. I did a test yesterday and deleted my actions and my functions layers (containing all the code) and the file size went down to about 50K. So I guess the answer is "Yes, code does add to file size"? Can anybody comment on that?
Also, does it matter what kind of code you have? Like, do complicated eval statements add more than hard-coded statements? Do any mc's added with duplicateMovieClip add a chunk?
Font Color And Size In Loaded Text...
Hi!
I am trying to load a text file and I would like to know
if there is a way through which I can chenge the font color
and font size. What I am trying to do is that I name the
dynamic text field as "Xyz" and then I use loadvariablenum
and then the text file starts with xyz= and after the =
sign comes the text. The text is loading, all I want to do
is change the font color and font size on some of the words
and I would like to know how to do that.
Can I Dynamically Change A Text Font Size?
I was just wondering... is it possible to change the text font size of a text field dynamically.
It might be obvious... but I just can't figure how this might be done.
I know that you could have the text in a movie say... and simply resize the movie to resize the text... but can you dynamically DIRECTLY change the text font size?
Any help would be appreciated.
Thanks.
Jam
Text Loads At A Huge Font Size Help?
ive attached the files associated with my problems.
ive got these buttons on the left that call for a new text file to load into the textfield to the right. they load a new text file but the font is gigantic, i just wanted it to be 10.
whats wrong with the script?
-andy
Font Size Problem With Dynamic Text
I've got a movie clip instance name = printArea and a dynamic text box that resides in it named = printTextBox. When I print this dynamic text box, the font size of the text is enormous and I can't get it resized. I've played with the dynamic text box in property panel and I've even did some coding on my script layer. Nothing works. I'm using Flash MX.
here's the script from the main timeline:
function displayResults() {
_root.createTextField("ResultTextBox", 1, 40, 150, 970, 500);
ResultTextBox.multiline = true;
ResultTextBox.wordWrap = true;
ResultTextBox.html = true;
_root.attachMovie("FScrollBarSymbol", "myScrollBar_sb", 2);
myScrollBar_sb.setScrollTarget(ResultTextBox);
myScrollBar_sb._x = ResultTextBox._x+ResultTextBox._width;
myScrollBar_sb._y = ResultTextBox._y;
myScrollBar_sb.setSize(500);
ResultTextBox.htmlText += Question1a_array.Question;
ResultTextBox.htmlText += CompareAnswer("1a", User_Answers_array.Question1a, Answer_Key_array.Question1a, Question1a_array);
ResultTextBox.htmlText += "<P>blank space</P>";
ResultTextBox.htmlText += Question1b_array.Question;
ResultTextBox.htmlText += CompareAnswer("1b", User_Answers_array.Question1b, Answer_Key_array.Question1b, Question1b_array);
ResultTextBox.htmlText += "<P>blank space</P>";
ResultTextBox.htmlText += Question2a_array.Question;
ResultTextBox.htmlText += CompareAnswer("2a", User_Answers_array.Question2a, Answer_Key_array.Question2a, Question2a_array);
ResultTextBox.htmlText += "<P>blank space</P>";
ResultTextBox.htmlText += Question2b_array.Question;
ResultTextBox.htmlText += CompareAnswer("2b", User_Answers_array.Question2b, Answer_Key_array.Question2b, Question2b_array);
ResultTextBox.htmlText += "<P>blank space</P>";
ResultTextBox.htmlText += Question3_array.Question;
ResultTextBox.htmlText += CompareAnswer("3", User_Answers_array.Question3, Answer_Key_array.Question3, Question3_array);
ResultTextBox.htmlText += "<P>blank space</P>";
ResultTextBox.htmlText += Question4a_array.Question;
ResultTextBox.htmlText += CompareAnswer("4a", User_Answers_array.Question4a, Answer_Key_array.Question4a, Question4a_array);
ResultTextBox.htmlText += "<P>blank space</P>";
ResultTextBox.htmlText += Question4b_array.Question;
ResultTextBox.htmlText += CompareAnswer("4b", User_Answers_array.Question4b, Answer_Key_array.Question4b, Question4b_array);
ResultTextBox.htmlText += "<P>blank space </P>";
// here's my problem
_root.printArea.createTextField("printTextBox", 2, -488.1, -445.8, 977, 768);
_root.printArea.printTextBox.multiline = true;
_root.printArea.printTextBox.wordWrap = true;
_root.printArea.printTextBox.html = true;
_root.printArea.printTextBox.borderColor = ffffff;
_root.printArea.printTextBox.htmlText = "[FONT SIZE= 2][/font]";
_root.printArea.printTextBox.htmlText = _root.ResultTextBox.htmlText;
}
Any ideas how to fix the font size issue?
p.s. I've put "blank spaces" between each question so you can't see the html code ([p] [/p]). That's why it's in brackets.
gladiator007
Changing Font Size Of Dynamic Text Box
i have created a scrolling text area in flash mx pro using a dynamic text box with text inside controlled by a couple of buttons using the .scroll property to add to the scroll value on each click of a button.
i am wanting to add two new buttons to decrease and increase the font size of the text within the dynamic text area, which i thought should be fairly easy. i found a .size property which could be applied to text, but i do not think i am using it in the right way. here's what i have tried to do (where 'myText' is the instance name of my dynamic text area):
on (release) {
myText.size += 10;
}
this does nothing.
i have a feeling i may have hoped this was a simpler process than it actually is. does anyone know how to get this function to work properly? do i need to set up a 'new TextFormat()'? if so, how?
Difference In Font Size For Dynamic Text Box
I'm have several movieclips that import text from external txt files, problem is, some mc display text in one size and the others display it in a smaller size. All movieclips were created from one main template so it's not the dynamic text box that's in each mc. Anyone have any ideas as to why?
Thanks,..
[CS3] Text Size Differences...same Font..same Movie
Hello everyone,
I have ran into a strange problem that I cannot figure out. On one layer I have some text sized at "35" and on the next layer I have some text also sized at "35". Both layers are using the same exact font. I cannot find any differences in the settings between the two text fields. I have attached two images showing the text along with the properties window to show the problem. (You have to click on the image to make it full size) Does anyone have an idea? I sure would appreciate it!
Smaller text
Larger text
Thank you,
Mark
Auto-resize Font Size To Fit Text Box.
I have some dynamic text enter the stage. The size of the box has to stay the same size. Rather, I would like the size of the font to automatically change depending on the amount of text entered (if it is a short phrase, the font will be big, if it is long, then the font will be small).
How is this accomplished? I'm brad new to flash but I am trying to do my research as best as possible.
Thanks for any help!
Change Dynamic Text Font Size
I have a dynamic text box that I do not want to be over 234 px wide. When I load in text that is too long, I simply want to resize the font size until it displays all characters. Here is what I have tried:
//Getting current format of description text field
f_picdesc = PictureDescription.getTextFormat();
while(PictureDescription.textwidth > 234){
f_picdesc.size = --f_picdesc.size;
PictureDescription.setTextFormat(f_picdesc);
}
Doing it this way creates an infinite loop as it appears that PictureDescription.textwidth never changes even though I setTextFormat. What am I missing or is there a better way to do this? Thanks for your help.
Change Dynamic Text Font Size?
How do I change the dynamic text font size using actionscript?
I'm looking to do something like "instanceName.text = 50" but can't figure out how to. Thank you!
Font Size On Externally Loaded Text
hi, the problem i'm having is that whenever i create an externally loaded text box, the text appears in a very large font . any suggestions would be appreciated
Font Size On Externally Loaded Text
hi, the problem i'm having is that whenever i create an externally loaded text box, the text appears in a very large font . any suggestions would be appreciated
Changing The Font Size Of Text Field
I've created a dynamic text field (instance = "speech_bubble") within a movie (instance = "bubble"). I want to change the size of the font within speech_bubble using actionscript but can't find the correct code for it.
Can anyone help?
Cheers,
Dynamic Text Font Size Problem
ok, i think i'm going nuts.
I've worked out a flash news ticker... but as soon as I try to change the font face of one of the items in the array, it doesnt display that particular item. (as shown in the example for the first item) any ideas?
i'm SURE its something little that i'm just missing.
here's the as..
SW = Stage.width; // scene width
SH = Stage.height; // scene height
var tickerItems = [
'<font size="25" face="arial">score number one</font>',
'<font size="25">score number two</font>',
'<font size="25">score number three</font>',
'<font size="25">score number four</font>',
'<font size="25">score number five</font>',
'<font size="25">score number six</font>',
'<font size="25">score number seven</font>',
'<font size="25">score number eight</font>'
];
MovieClip.prototype.getTickerItem = function(n)
{
this.idx = n;
this.ticker_txt.htmlText = tickerItems[n];
this.startTime = getTimer();
this.ticker_txt._x = 0;
this.ticker_txt._y = -this.ticker_txt.textHeight/1.75;
this._x = SW;
this._y = SH/2;
}
function cycleTicker()
{
this._x -= this.speed;
if (this._x <= -this.ticker_txt.textWidth)
this.getTickerItem((this.idx+1)%tickerItems.length);
}
var mc = this.attachMovie("ticker_mc", "ticker_mc", i);
mc.ticker_txt.autoSize = "left";
mc.ticker_txt.html = true;
mc.getTickerItem(0);
mc.idx = 0;
mc.speed = 5;
mc.onEnterFrame = cycleTicker;
mc.onRollOver = function() { this.speed = 2; }
mc.onRollOut = function() { this.speed = 5; }
thanks in advance!
ck
How Does Flash Change The Font Size To Fit The Variable Text
hi,
I made a text box and set a variable and I control the text with html tags,please check:
http://www.macromedia.com/support/fl..._variables.htm
Now, I want users write as much as they want and I want flash to change the font size to fit the text into the box.İf they write too much font has to get smaller.
How can I do that?
Thanks for your time,
Large Font Size In Reduced Dynamic Text
large font size in reduced dynamic text:
I am using an email form. The original size was 500x400 or something similar. I reduced the size to 160x100.
The problem is that the font size in a dynamic text field on the form which receives input from a php file is now HUGE. Even if i now set the font size to 8.
Do you know of a solution to this?
TIA
Changing Font Size In Dynamic Text Field
I'm trying to change the size of a font in a dynamic text field.
Keep in mind, the text field is not dynamically generated using createTextField.
I've tried the following with no success:
myTextFormat = new TextFormat();
myTextFormat.font = "Verdana";
myTextFormat.size = 40;
newbutton2.myLabel.setTextFormat(myTextFormat);
Where newbutton2.myLabel is the instance name of the text field.
Changing Of The Font And Text Size In CheckBox Component
hi,
Components are very useful, but they seem difficult to customize.
Is it possible to change the font and maybe color of the text in CheckBox components. Under their "Parameters", I can only see a few options.
thank a million.
Lawrence
Resize Font Base On Text Field Size
Hi I am trying to create a new movie clip, add a text field to it then resize the font based on the size of the text field, I have this code, but it doesn't seem to work could someone point out where I am going wrong?
value_arr is just an array of strings.
Code:
var mc_arr:Array = new Array();
for(i=0; i<value_arr.length; i++){
var value_mc = _root.createEmptyMovieClip("value_mc"+i,_root.getNextHighestDepth());
value_mc._width = 25;
value_mc._height = value_mc._width;
value_mc.createTextField("value_txt",0,0,0,value_mc._width,value_mc._height);
value_mc.value_txt.wordWrap = true;
value_mc.value_txt.text = value_arr[i];
var txt_fmt = new TextFormat();
txt_fmt.font = "arial";
txt_fmt.size = 14;
while(value_mc.value_txt.textWidth >= value_mc.value_txt._width){
txt_fmt.size -= .5;
value_mc.value_txt.setTextFormat(txt_fmt);
}
value_mc._x = 50;
value_mc._y = value_mc._x;
mc_arr[i] = value_mc;
}
Set Font Size For Dynamically Created Input Text
I bet there is a simple answer to this one, but I just haven't been able to find it.
I have input texts that I programatically create. Some are taller than others, but all are single line. So I would like to be able to set the size of my text inside the textboxes. I have poked around with using setTextFormat on the input text boxes, and looked at using programatic stylesheets, but that seems like that is the wrong way to go.
var inputTxt = new TextField()
inputTxt.width=myWidth;
inputTxt.height=myHeight;
inputTxt....? to set the font size.
...
this.addChild(inputTxt);
Font And Size Issues W/ Dynamic Text Boxes
Hi all,
I have been having a repeating problem with the dynamic text boxes in flash. I have one that is supposed to be Arial 12pt text inside. But it always shows as times new roman 12pt text instead. I have repeatedly destroyed the object and re-created it, but to no avail. It gets its data for the text box from an array in flash and it's not HTML enabled so I know its not getting any formatting through htmlText but I am stuck as to whats going on with it.
Anyone have any ideas to try?
Also, I've noticed that if I have a text box with say ANY font 12pt. If I increase the height of the text box my font size (when displayed) increases as well. Even though it still says 12pt in the properties window. Any ideas?
Is this a bug, or a feature ?
Thanks
mcm
|