Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Autosize Dynamic Textfield?



Is it possible to adjust the height of a dynamic textfield automaticly to the amount of text in it? I want to make several textfields underneath eachother and fill them dynamicly with php. So if I make them all at the same height it looks weird if one textfield contains more text then the other, there has to be only one break between all textfields and i dont want to use scroll at each textfield



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 02-27-2006, 12:08 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Help With AutoSize A Dynamic TextField
Hi,

I'm loading text into text fields that are animated onto the screen. What happens is that I can't seem to autoSize them. This is what I have for autoSize.


Code:
this.myTitle.autosize = true;
This is my code for animating the textFields onto the screen.


Code:
//--------------------------------------------------------------
// loading Section 2 AKA INCLUDES
//--------------------------------------------------------------
function loadsubSection2(){

for (i=0; i < subSection2.length; i++) {

var n = _root.attachMovie("subSection2TXT","subSection2TXT"+i,this.getNextHighestDepth(),{_alpha:0});

if(i > 4){

n._x = 450;

} else {

n._x = 0;
}

n.myTitle.text = subSection2[i];
n.myTitle.autoSize = subSection2[i];

if(i == 0){

n._y = 180 + 14 * i;

} else {

if(i > 4){

var _l1:Number = _root["subSection2TXT"+(i-1)]._height;
n._y = 180 + _l1 * (i-5) + 25*(i-5);

} else {

var _l1:Number = _root["subSection2TXT"+(i-1)]._height;
n._y = 180 + _l1 * i + 25 * i;
}
}
var time:Number = 0.5+(i+1)*0.2;
animesubSection2(n, i, 142, 297, 100, time);
}
sub2loaded = true;
}

function animesubSection2(n:MovieClip, i:Number, _x1:Number, _x2:Number, newAlpha:Number, myTiming){

if(i > 4){

n.tween("_x",_x2,.5,"easeInQuad",myTiming);
n.alphaTo(newAlpha,.5,"easeInQuad",myTiming);

} else {

n.tween("_x",_x1,.5,"easeInQuad",myTiming);
n.alphaTo(newAlpha,.5,"easeInQuad",myTiming);
}
}
So the textFields get created with this for (i=0; i < subSection2.length; i++)

Can anyone see why this isn't working for me. What am I doing wrong

Dynamic Positioning / Textfield / Autosize
ok, basicily what im trying to do is convert some string to array, and populate it to separate dynamic textfields, so I will be able to make every word clickable. No problem with that. What im strugling with is positioning a textfields like they are layout in a normal textBox. For some reason it's behaves very funny unless I change the autosize to "right" but then im running into trouble when spliting a text to few lines instead of having a very long one. (look commented field)

hopefuly someone can understand what my problem is. attache *FLA might be helpful.


Please help
Thank you
/M



code:
str = "at some point you may have to be a flash-db member to use is the web service we are invoking in this case"
var myWords = [];
myWords = str.split(" ");

for (var i = 0; i < myWords.length; i++) {
_root.holder.attachMovie("textField_mc","word_"+i, 100+i);
var word = _root.holder["word_"+i];
if (i != 0) {
var previousWord = _root.holder["word_"+(i-1)]
var previousWordWidth = previousWord._width
} else {
var previousWord= 0;
var previousWordWidth = 0;
}
word.label.autoSize = true;
word.label.text = myWords[i];
var w = word._width;
word._x = previousWord._x + w
trace(word._x)
//if (word._x > 200) {
//word._y +=20
//}
}

Dynamic Positioning / Textfield / Autosize
ok, basicily what im trying to do is convert some string to array, and populate it to separate dynamic textfields, so I will be able to make every word clickable. No problem with that. What im strugling with is positioning a textfields like they are layout in a normal textBox. For some reason it's behaves very funny unless I change the autosize to "right" but then im running into trouble when spliting a text to few lines instead of having a very long one. (look commented field)

hopefuly someone can understand what my problem is. attache *FLA might be helpful.


Please help
Thank you
/M

str = "at some point you may have to be a flash-db member to use is the web service we are invoking in this case"
var myWords = [];
myWords = str.split(" ");

for (var i = 0; i < myWords.length; i++) {
_root.holder.attachMovie("textField_mc","word_"+i, 100+i);
var word = _root.holder["word_"+i];
if (i != 0) {
var previousWord = _root.holder["word_"+(i-1)]
var previousWordWidth = previousWord._width
} else {
var previousWord= 0;
var previousWordWidth = 0;
}
word.label.autoSize = true;
word.label.text = myWords[i];
var w = word._width;
word._x = previousWord._x + w
trace(word._x)
//if (word._x > 200) {
//word._y +=20
//}
}

Problems With Autosize In Dynamic Textfield
Hi everyone!
Well, I've been hours fighting this and I guess I lose...

I have a dynamic text, where I load an external XML text, and it's style is loaded from an external CSS. This is part of the code of that part of the movie:

Code:
//set text properties.
todocursos.texto.cursotexto.html = true;
//todocursos.texto.cursotexto.autoSize= true;
todocursos.texto.cursotexto.wordWrap = true;
todocursos.texto.cursotexto.multiline = true;
todocursos.texto.cursotexto.label.condenseWhite = true;
//Style.
textoStyle = new TextField.StyleSheet();
textoStyle.load("datos/style.css");
todocursos.texto.cursotexto.styleSheet = textoStyle;
//xml UNO
_global.textouno = new XML();
_global.textouno.ignoreWhite = true;
_global.textouno.onLoad = function(exito) {
if (exito) {
trace("ok");
todocursos.texto.cursotexto.text = _global.textouno;

} else {
trace("not ok");
}
};
_global.textouno.load("datos/3dgral.xml");
The autosize doesn't work, and that really bothers... So I looked for a solution searching other threads about this, and I found this one.

But that doesn't work right... the textfield doesn't resizes allways the same, sometimes it even "cuts" text. And I tried to adapt it to my site in a thousand ways, but I can't fix it.

żAny Idea of what's wrong?

Problem With Autosize In Dynamic Textfield.
Hi everyone!
I hope you can help me with this. I'm working on Flash 8, btw.

I have a dynamic textfield where I load external XML and CSS stylesheet. I want the textfield to automatically resize when another XML is loaded into it, and I know the common thing is seting the textfield to autoSize="left", but it's not working for me, and I don't know why. wordWrap is also set to true.
The problem is that the textfield DOES resize, BUT as if no text had been loaded (the height of the textfield turns to 10 pixels or so). I checked timeline problems and stuff but everything seems ok...

Here's my code (where I load the XML and CSS in the textfield)


Code:
//set text properties.
todocursos.texto.cursotexto.html = true;
todocursos.texto.cursotexto.autoSize= true;
todocursos.texto.cursotexto.wordWrap = true;
todocursos.texto.cursotexto.multiline = true;
todocursos.texto.cursotexto.label.condenseWhite = true;
//Style.
textoStyle = new TextField.StyleSheet();
textoStyle.load("datos/style.css");
todocursos.texto.cursotexto.styleSheet = textoStyle;
//xml UNO
_global.textouno = new XML();
_global.textouno.ignoreWhite = true;
_global.textouno.onLoad = function(exito) {
if (exito) {
trace("ok");
todocursos.texto.cursotexto.text = _global.textouno;

} else {
trace("not ok");
}
};
_global.textouno.load("datos/3dgral.xml");
Thanks in advance!

Dynamic Positioning / Textfield / Autosize
ok, basicily what im trying to do is convert some string to array, and populate it to separate dynamic textfields, so I will be able to make every word clickable. No problem with that. What im strugling with is positioning a textfields like they are layout in a normal textBox. For some reason it's behaves very funny unless I change the autosize to "right" but then im running into trouble when spliting a text to few lines instead of having a very long one. (look commented field)


Please help
Thank you
/M

ActionScript:--------------------------------------------------------------------------------
str = "at some point you may have to be a flash-db member to use is the web service we are invoking in this case"
var myWords = [];
myWords = str.split(" ");

for (var i = 0; i < myWords.length; i++) {
_root.holder.attachMovie("textField_mc","word_"+i,100+i);
var word = _root.holder["word_"+i];
if (i != 0) {
var previousWord = _root.holder["word_"+(i-1)]
var previousWordWidth = previousWord._width
} else {
var previousWord= 0;
var previousWordWidth = 0;
}
word.label.autoSize = true;
word.label.text = myWords[i];
var w = word._width;
word._x = previousWord._x + w
trace(word._x)
//if (word._x > 200) {
//word._y +=20
//}
}

Multiline Dynamic Textfield Autosize Not Working?
I am trying to autosize a Multiline Dynamic Textfield, but it doesnt work...if i change the textfield to a single line, my AS autoSize=true works fine...but if its set to be a multiline it doesnt shrink if the text is smaller than it.

How do i get my multiline textboxes to shrink to be efficient, so theyre only as big as the stuff in them?

Textfield.autoSize ?
hi all,

When creating some tips for my buttons (or MC,etc) I couldn't make the dynamic text field which I created on the stage to automatically resize to match the dynamic text?

I've tried mytext.autoSize but it didn't work?

any idea?

Thanks in advance

Textfield AutoSize ...
Is there a way to detect how many lines a textfield will expand to when "autoSize" is enabled? I have various items below the expanding-textfield that reposition based on the vertical size of the textfield, but would prefer the items go directly to the final size as opposed to resizing as the textfield expands... it ends up looking somewhat jerky.

TextField.autoSize
Hey,

I'm dynamically populating and arranging some text fields, but there seems to be a delay between when I set the text of a dynamic text field and when the width/height attributes update:

Code:

myTextField.autoSize = TextFieldAutoSize.LEFT ;
myTextField.text = "hello world" ;
trace(myTextField.width)

traces out the width of the text field before I changed the text.

Adding a click event to it that traces the width works though.

How do I get around this?


thanks

Textfield.autoSize
i use textfield.autoSize to build a project fuiled with dynamic placed objects.

if i place the objects trough code on the stage, and ask for the size of the movieclip (who's the container of the textfield), i always get the size of the movieclip before the text is loaded in it. anyone got an idea how i could solve it?

i load the text in the movieclip before attaching em to the stage, this is the code i use to attach em


Code:

for (var a:Number = 0; a <= voordeel_titel.length - 1; a++)
         {
            var tempVoordeelMc:MovieClip = voordeelCont_mc.attachMovie("voordeel_mc", "voordeel" + a + "_mc", a + 1);
            tempVoordeelMc.titel_txt.text = voordeel_titel[a].firstChild.nodeValue;
            tempVoordeelMc.tekst_txt.text = voordeel_tekst[a].firstChild.nodeValue;
            tempVoordeelMc._x = 10;
            tempVoordeelMc._y = tempVoordeelMc._height* a;
         }

Set Focus To Autosize Textfield
Help!

Is it possible to set focus to a input textfield
that has autoSize property set true?

I tried even change the autoSize property after setting focus and still the textfield loses focus.

this.my_textfield.onSetFocus = function(oldFocus){
this.autoSize = true;
};

Textfield .autoSize Listener?
Hi all,

I have textfield with autosize set to true so it grows to the bottom.
Is it possible to add an listener to catch the changes in size when the user types?

i tried with resize but that didnt work,
do i have to work something out with the onchanged listener to get the result?

thnx alot

greetz

TextField Properties With Autosize
I ran into this weird problem.

when I create a TextField dynamically and set the autosize to true, assign the text and then try to retrieve the _height property, it gives me a wrong value. I'm using this to put a text below an image, after that I draw a border around the text and image combined...

When I'm using trace, like below it works good, but traces the wrong height.


ActionScript Code:
container_mc.img_text.autoSize = true;
container_mc.img_text.text = txt;
       
format.leftMargin = format.rightMargin = width / 50;
container_mc.img_text.setTextFormat(format);
trace("text height: " + container_mc.img_text._height);
height += container_mc.img_text._height;

Are there any solutions or workarounds for this problem?

TextField AutoSize Not Working
I have a text field with its autoSize property set to TextFieldAutoSize.LEFT, but it doesn't expand to fit larger text values.

I've tested a textfield in a blank FLA and it works fine, but in my app, the field doesn't resize.

Anyone have any ideas??

TextField AutoSize And Height
A bit perplexed about something...

I'd like to have a fixed-width, multiline textfield, but one where the height auto-adjusts.

i.e. - in the example below, where forceWidth is a Number vs. null, the TextField has the default height of a newly created TextField, rather than the else statement, where the TextField's height is the same as its content.

I want the height of the TextField to always be that of the content.


Code:
var label:TextField = new TextField();
label.background = true;
label.border = true;

if (forceWidth) {
label.width = forceWidth;
label.wordWrap = true;
} else {
label.autoSize = TextFieldAutoSize.LEFT;
}

label.defaultTextFormat = format;
label.text = txt;

TextField Horizontal Autosize : Possible ?
Is there a way to have textField autosize horizontally ?

I need to have a dynamic textField that has a fixed height (3 lines), and if there is more text, have it expand horizontally (to the right)...

All the autosize value from the textField class seem to expand to the bottom...

Textfield Autosize Bottom
how can i make a textfield that autosizes down ?

this.createTextField("back_text", 1, 5, -200, 115, 18.5);
back_text.multiline = true;
back_text.wordWrap = true;
var my_fmt:TextFormat = new TextFormat();
my_fmte.color = 0x000000;
my_fmte.font = "Verdana";
my_fmte.size = 12;
back_text.text = "bla bla bla bla bla nla";
back_text.setTextFormat(my_fmte);

AutoSize Multiline Textfield?
Hello, does anyone know if it is possible to autoSize a multiline textfield?
In the examples of Adobe they use a single line textfield.

For example, if you draw a very wide en very hight textfield on the stage and you check multiline and
check the textfield background color and use this as code:

your_txt.text = "Hello world";
your_txt.autoSize = TextFieldAutoSize.LEFT;

The height will be autoSized to one line, but the width still keeps the same.

You probably think, why don't you use a single line? Well, what if my text is more then one line?
Then you would get a very long sentence.

Anyone has an idea on this?

Autosize Textfield & Filter?
Hi there,
I have a dynamic textfield in a tickertape movieclip.
The textfield is set to autoSize = true and this works fine.
However if I apply a dropshadow filter the text dissapears or the filter does not apply.

The filter works fine when I don't use the autosize property

Suggestions anyone?

TextField, Autosize Vertically ?
hi guys!

is there a way to create a textField using acitonscript and then when i add information to it can autosize vertically ?

for example has a fixed 300 horizontally and then it can autosize vertically when has a lot of information

thx for any help!

Set Focus To Autosize Textfield
Help!

Is it possible to set focus to a input textfield
that has autoSize property set true?

I tried even change the autoSize property after setting focus and still the textfield loses focus.

this.in_fo.onSetFocus = function(oldFocus){
this.autoSize = true;
};

Textfield.autosize With An External Txt File (MX)
Hi Guys

Thanks for taking the time to read this.

I'm still very new to Flash and actionscripting so be gentle. With the help of some you guys (THANKS) I've just created a fla that has a series of buttons, 12 in total. Each button has a title and a url both of which are called from an external text file. This works great my only concern is that at some stage i'm sure i'll end up having to put a title thats longer then the textfield, what I was looking for was a way to dynamically scale the text, i believe that textfield.autosize can do this but am having problems getting it to work. I'm sure its because im a flash virgin and i'm doing something stupid.

Where exactly would i place the actionscript within the movie for each textfield. I have a layer for text with each textfield variable called ButtonName1, ButtonName2 etc. I have a layer for the buttons with each button using the geturl action ie; _root.url1, _root.url2 etc, . And I have a loadVariablesNum("links.txt", 0); frame action an a seperate layer. I have placed the autosize variable in this layer as ButtonName1.autosize = "center"; but it doesn't appear to work. The whole movie is 1 frame long just in case that makes a difference.

Any ideas.


Cheers

Wass

Textfield AutoSize Problem In Flash 8
Hi guys

I have a strange problem..I have a movieclip in the stage and i duplicate it coupe of times and arrange it particular set of rows.This movieclip have a dynamic textfield inside it and the autoSize is set to "center" The antalias option is set to "Antialias for reading"

I take couple of words stored in an array and put in this textfield..Now for some words the last character is either cut off or getting blurred or soemthing like that..Take a look at the screen shot of the actual problem and a demo of the problem.. and please let me know whether any of you guys ever experienced the same problem and a solution to this?Attached the fla also..So you can check and see if same problem occurs in yourmachine...

thanks
shan

TextField AutoSize Extra Line
Hello,
If I copy a text in htmlText textfield, that is set to autoSize, an extra line is created. How can I avoid that this extra line is created?


HTML Code:
import fl.controls.Button;
var myText:TextField=new TextField();
var storeText:String;
addChild(myText);
myText.border=true;
myText.width=200;
myText.autoSize=TextFieldAutoSize.LEFT;
myText.type=TextFieldType.INPUT;
myText.multiline=true;
var myButton:Button=new Button;
addChild(myButton);
myButton.x=300;
myButton.y=100;
myButton.addEventListener(MouseEvent.CLICK, myButtonF);
function myButtonF(event:MouseEvent){
storeText=myText.htmlText;
myText.htmlText="";
myText.htmlText=storeText;
}

Textfield Autosize Bug? Text Gets Chopped Off
Hi all,
am facing what I think is a bug. Am using Dynamic textfields in flash 8 with autosize = true for some navigation i am developing.

But I notice that the text gets chopped off at the sides and the bottom.



Have tried changing fonts and some other mundane workarounds, but to no success. Wondering if anyone faced this w/ possible solutions.


Linked below is my working file for reference.

http://www.lyrradnahc.com/misc/text_test.fla

cheers

[as] How To Check Size Of An Autosize Textfield?
Ok here is the situation.

I have a movieclip in my library that is linked as article_MC.
In this movieclip I have a title_txt textfield and a article_txt textfield.
My title_txt textfield is just a normal textfield on a single line. My article_txt textfield (multi line) is set to wordWrap = true and autosize = true so that it always stays the same width yet can change in height depending on how much text I have.

I loop through an XML file that has some news articles that are different sizes. Everytime the loop reaches a new article it attaches my article_MC movieclip to the stage and sets title_txt to the attribute called title and article_txt to the nodeValue of the article.

Now what I would like to have is to position each new article at a _y coordinate that is the height of the last article + the _y of the last article, but the _height of the last article still has the value it had initially before text was entered into it.

so is there a way to find out the real height of this movieclip while still looping through my XML file?

here are the ressources:

http://konstructs.com/news.zip

AS3 - TextField AutoSize - Height Not Updating
Hi

Can anyone tell me if there is something wrong with my code?
I followed a tutorial word for word on Lynda.com to create a dynamic text field and scroll some text in it. The tutorial on Lynda.com works 'fine and dandy' but mine doesn't.

I have attached my code and accompanying files.

Basically I load some text and apply a stylesheet.
I then load this into the dynamic textfield (external_txt) which lives within text_mc.
I then perform some calculations and attempt to scroll.
I am certain the calculations are correct. It is just that when the textfield doesnt resize the values end up wrong and the results is th text scrolls in the wrong direction.


There is a line of code that says:
text_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;

However, when I trace the height of text_mc (within the textLoaded function) the height has shrunk rather than autosized to a bigger value.

The result of this is that my text scrolls in the wrong direction when I use the drggable scroller (scroller_mc).

Can anyone advise?

Many Thanks

















Attached Files

Textfield.autoSize= True, But Can Cause Blurry Tex
High guys i have been doing some teewking to my forum.
One of the things was to make the viewpost text area autoSize to the amount of data returned from the db, It works fine. I have found though when the text returned is a lot (When _hieght.textfield exceeds 300px) the autoSize sets the _hieght @ 300.5, 359.33 etc.
Please how can i stop this
It's making my text blurry

Cheers
Paul

Autosize For A TextField Created Dinamically
It seems that
myTextField.autoSize = "left"
let me change the bottom border but not the right border as I write on it.
is this a bug? or am I missing somthing.

The whole chunk of code that i am using and that can be pasted in the fisrst frame of an empty movie reads:

_root.createTextField("testo", 10, 20, 20, 200, 80);
testo.type = "input";
testo.border = true;
testo.multiline = true;
testo.wordWrap = true;
testo.embedFonts = false;
miformato = new TextFormat();
miformato.font = "Arial";
miformato.size = 17;
testo.autoSize = "left";
testo.setNewTextFormat(miformato);

Thanks in advanced for your help, Eduardo.

Textfield.autoSize= True, But Can Cause Blurry Text :( Help
High guys i have been doing some teewking to my forum.
One of the things was to make the viewpost text area autoSize to the amount of data returned from the db, It works fine. I have found though when the text returned is a lot (When _hieght.textfield exceeds 300px) the autoSize sets the _hieght @ 300.5, 359.33 etc.
Please how can i stop this
It's making my text blurry

Cheers
Paul

Post Textfield.autosize Height Variable?
With a dynamic textfield that has been autosized (in this case, autosize = "center"), is it possible to retrieve the *new* height of the text field? It appears that the script uses the original height of the textfield as specified on the stage, not the height assigned after the script executes.


PHP Code:



this.textfield.autoSize = "center";
loadVariables("announcements.txt", "_root.announcements.boxcontent");
// The line that's giving me trouble...
this.bg._height = this.textfield.textHeight + 14;
stop();




I've also tried...


PHP Code:



this.bg._height = this.textfield._height + 14;




And had no luck there either. I Googled (Flashkit's search function isn't working for me - is anyone else having that problem?) and found another guy with the same problem, but the thread was inconclusive.

Textfield.autosize Cuts Off One Line Of Text
I'm loading text into a dynamic textfield through XML and I have the textfield autosize property set to true. Everything is working perfectly except that it cuts off the LAST line of text.

Do you have any idea why it might do this?

Post Textfield.autosize Height Variable?
I tried posting this question on the FlashKit forums, but no one could give me a solution. I also tried using the loadVars object to ensure the text was loaded when the script ran, and that didn't work either...

With a dynamic textfield that has been autosized (in this case, autosize = "center"), is it possible to retrieve the *new* height of the text field? It appears that the script uses the original height of the textfield as specified on the stage, not the height assigned after the script executes.


PHP Code:





 this.textfield.autoSize = "center";
loadVariables("announcements.txt", "_root.announcements.boxcontent");
// The line that's giving me trouble...
this.bg._height = this.textfield.textHeight + 14;
stop(); 






I've also tried...


PHP Code:





 this.bg._height = this.textfield._height + 14; 






And had no luck there either. I Googled and found another guy with the same problem, but the thread was inconclusive.

Live Preview Problem Textfield Autosize
hmmm somewhere cached files was used or something

Setting TextField.autosize Kills TextFormat Functionality?
Hi all.

I have a dynamic text field which needs to change size (in _x only) to accomodate whatever text I throw at it. I have achieved this by using myTextField.autosize = "right"; and it works a treat.

I also want to be able to set the formatting for the field through script for which I have been using TextFormat (I'm using TextFormat over HTML formatting for a variety of reasons). This works a treat.

My problem:
TextFormat works a treat until I apply the TextField.autosize, then TextFormat seems to fail completely!!

Am I missing something? Is this a bug? Is there a workaround?

Note: I'm developing for Player 6 so can't use 7's support for CSS which is just tearing me apart!

Thanks in advance.

DropShadow Filter On Textfield With Autosize=true Dosent Resize
Hey guys, Ive been scratching my head at this, hopefully someone knows a workaround. I create a new text field, set it unselectable, have it use embedded fonts, turn the border on so you can see where its art, attach my text format, then apply the dropshadow filter. Heres the weird part: If autoSize is true, it will render the dropshadow, if its false it wont. So why not just set autoSize=true and be happy? If the textfield is stretched larger than it was originally, flash seems to just stop drawing the field outside of the original space. For an example, make a new fla (or see attachments), make a dynamic or input text on the timeline, set it to Tahoma (or whatever, just update the code to reflect it) and have it embed at least the alphanumeric chars, then paste this code and run it. then comment out the autosize, filter, textformat, etc lines and see what happens. The drop shadow is red so its noticeable, but do you see how it just stops drawing? Any ideas? Thanks FK!


Code:
import flash.filters.DropShadowFilter

var _displayTextField:TextField = _root.createTextField("displayField",1,0,0,100,100);
_displayTextField.selectable = false;
_displayTextField.embedFonts = true;
_displayTextField.wordWrap = true;
_displayTextField.border = true;
_displayTextField.autoSize = true;
var tf:TextFormat = new TextFormat("Tahoma",12,0x333333, null,null,null,null,null,"center");
_displayTextField.setNewTextFormat(tf);
_displayTextField.text = "hello";
//(distance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject);
var _displayTextFilter:DropShadowFilter = new DropShadowFilter(2, 45, 0xFF0000, .8, 2, 2, .6, 1, false, false, false);
_displayTextField.filters = new Array(_displayTextFilter);
_displayTextField._width = 400

this.onEnterFrame = function() {
_displayTextField._width += 5;
};

How To Retrieve A TextFields.height Property When TextField.autoSize Is Enabled?
I have a TextField that has the autoSize property set to TextFieldAutoSize.LEFT; and for some reason when I try and retrieve the textField's height property like this "myNumVar = textField.height" it always returns the value of 100, even though the text fields height is nothing like this. Furthermore when I input a larger or smaller amount of text into the field, the height property still returns 100.

If anyone has any ideas on how I can retrieve an accurate height value then please let me know

Can You AutoSize Dynamic Text?
I have two dynamic text fields on the stage. How can set the text to autoSize?
I have this, but it's not working.

ActionScript Code:
w.text.autoSize = true;w.text = "100";h.text.autoSize = true;h.text = "100";

Dynamic Text AutoSize Issues...
I am having trouble with my dynamic text autosizing in MX. I have debugged the movie, and everything appears to be in order (autosize=true, wordwrap=true, etc.) But when I publish the movie, the text box does not resize appropriately (set to autoSize = "center";

Here is a sample of what I'm talking about. The first choice should read exactly the same as the question.

I have done this before and had it work, like in this swf. The autosize works just fine.

Any suggestions or words of wisdom?

Thanks,
Dain

Problem W/ Dynamic Textbox Autosize
I'm having a problem with adjusting the size of a dynamic textbox to display text imported from an external XML file. I've tried using .autoSize = true, but it doesn't work.

Any help would be appreciated.

Dynamic Text Field AutoSize
So, I have created an xml-supported Array of news boxes (a movie containing dynamic text fields). One text field needs to be autoSize(d) so I put " myText_instance.autosize = true " into the movie's actions. But when I play the movie, the Array does not create a different sized news box (based on the amount of text in each) it just covers the other news boxes with remaining text. Basically, I need each news box to be reliant on the amount of text not the reverse. I think this may be a sequencing problem: the xml text is loaded after the Array has been created? Maybe its just a matter of putting the code in the right place on the timeline? This is probably simple structure and any suggestions are greatly appreciated!

Problem W/ Dynamic Textbox Autosize
I'm having a problem with adjusting the size of a dynamic textbox to display text imported from an external XML file. I've tried using .autoSize = true, but it doesn't work.

Any help would be appreciated.

Scrollpane And Dynamic Text Field With Autosize
I've build a movie that communicates with a SQL server by ASP.

I use several MovieClips that contain several images and text fields (on for the title, one for the abstract and one for the main text).

Between the abstract and main text, 0 till 3 thumbnail images can be displayed. SO the main text field dynamicly moves up or down to make space. The main text field also has to autoSize to display the entire main text.

On the main timeline I use a standard object: the scrollpane. This object displays the MovieClip and should give a scrollbar functionality when the content in the MovieClip doesn't fit on the screen. Well it doesn't!

It does when I put a MovieClip to it with a large text field in it. But when the text field has to autosize or some content (like images) are dynamicly displayed or hidden, it doesn't function like it should. The scrollbars arn't displayed at all, or you can't scroll the entire content.

HELP ME!!!!

Maik.

(sorry for my bad English)

Autosize Dynamic Box Based On No. Of Chars And Align
Very new to this, appreciate any help!

I have 1 dynamic text box which is a counter. Immediately to the right of this I have a static text box.

There should be a small gap (eg. 15px) between the end of the text in the dynamic text box and the start of the text in the static box.

How do I make the dynamic tbox autosize then put the static box 15px after it?
*As the dynamic box holds numbers, I don't want it to resize every time the numbers change (as it sort of flickers all the time as some numbers like 1 are more narrow than numbers like 6).
But, I just want it to resize when for eg. it goes from 100,000 to 99,999 and then from 10,000 to 9,999. So just when the number of digits and "," change.

Many thanks in advance

Dynamic Menu - AutoSize And Position Buttons
Ok this seems so trivial and yet I'm struggling here. I'm attempting to build a dynamic menu from external data. I'm trying to autosize the buttons to match the textfields and butt them up against one another (to look essentially like the top menu on this forum looks).

forums - tutorials - library - movies - etc......

Here's the code I have so far. I commented the trouble spots.


ActionScript Code:
navBarElements = new LoadVars();
navBarElements.load("nav.txt");
navBarElements.onLoad = function(success) {
    if (success) {
        myNavArray = _root.navBarElements.navigationBar.split("*");
        numberOfElements = _level0.navBarElements.numElements;
        _root.sliderNav1.navigation._visible = 0;
        for (i=0; i<numberOfElements; ++i) {
            _root.sliderNav1.navigation.duplicateMovieClip("clip"+i, i);
            _root.sliderNav1["clip"+i].createTextField("navText", 10000, -62, -9.5, 0, 0);
            _root.sliderNav1["clip"+i].navText.autoSize = "center";
            _root.sliderNav1["clip"+i].navText.selectable = false;
            _root.sliderNav1["clip"+i].navText.text = _level0.myNavArray[i];
            _root.sliderNav1["clip"+i]._width = _level0.sliderNav1["clip"+i].navText.textWidth+15;
            _root.sliderNav1["clip"+i]._x += // I'm trying to position the next button to the far right border of the previous button.  How do I do this?;
        }
    }
};

Color Change And Autosize On Dynamic Text Field
I have a script that loads a .txt file to a dynamic textfield. I need to have the text change in color when the mouseover. I've created a button out of that textfield and created its rollover state. It works fine, but then i also need to automatically resize the textfield to fit nicely with the amount of text loaded.

It works fine with autoSize property if the textfield is not inside a button. But once i put the textfield inside a button, it doesn't work.

This is what i have:
a dynamic textfield inside a button inside a movieclip.

The scripts on root timeline:

Code:
loadVariables ("txtFiles/clientNames.txt","myClip");//this loads fine
_root.myMovieClip.myButton.myTextField.autosize = left;//this doesn't work
Help anyone? Or is there an easier way to have the text color change when mouseover a dynamic textfield?

Thanks in advance,

AutoSize Property Of Dynamic Text Box - Loading Problem
I'm trying to load text dynamically from a text file into a dynamic text box. The text box is inside a movie clip that's being scrolled with a ScrollPane component.

When I test the my site locally, everything works fine. However, when I upload it and test the page, the size of the text box is not recognized right away. The scroll bar on the ScrollPane component isn't there. I have to refresh the page in order for the scrollbar to show up and the text box to be sized properly. I'm not sure what the issue is. Here's the script I'm using:

events.autoSize=true;
events.html=true;
eventsLoadVar = new LoadVars ();
eventsLoadVar.load("documents/events.txt");
eventsLoadVar.onLoad = function (success){
if (success == true) {
events.htmlText=eventsLoadVar.eventstext;
}
}

It's driving me nuts because I can't figure it out!

Copyright © 2005-08 www.BigResource.com, All rights reserved