PDA

View Full Version : about Text fields



Garbage Donkey
September 10th, 2003, 03:35 AM
From what I have seen, there is some way to auto fit text in flash. Say you have something that involves user input, and then displaying that in a text field. well Say the put a BUNCH of text in there, I was wondering if there was a way to make flash say HEY our text box is too small, Lets get bigger to conform the text ! ? Well something like that, I don't really know if flash would be that happy to do it, however i did find some code that sort of looked like what I wanted, but I just don't know how to implement it , if I am say using a local shared object to save some user input, and then displaying that in nice neet little package no matter how much they input.

here is the random sections of code that I think mean something.


topic.titleformat = new TextFormat();
with(topic.titleFormat) {
color = 0xcc0000; // deep red
font = "Genetica";
bold = false;
leftMargin = 3; // testing
size = 10;
}
topic.title.setTextFormat(topic.titleformat);

AND

this.createTextField("tfNewfield",1,10,10,150,30);
tfNewfield.text = "Here's some text";
fmtEmphasis = new TextFormat();
fmtEmphasis.bold = true;
fmtEmphasis.size = 16;
fmtEmphasis.font = "Georgia";
tfNewfield.setTextFormat(fmtEmphasis);



I have no clue how to integrate these, so if anyone could please help me I'd be verrrrrry thankfull !

kode
September 10th, 2003, 04:54 AM
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary729.html

Garbage Donkey
September 10th, 2003, 05:35 AM
thank you thank you thank you thank you thank you !

kode
September 10th, 2003, 05:42 AM
You're welcome, you're welcome, you're welcome! :P

Garbage Donkey
September 10th, 2003, 03:16 PM
Alright so this all worked, NOW for another question MWAHAHAHAHAHAHAH , So say I have two of these text boxes with a good amount of writing in each. Would there be a way to place them inside of something , like another object to make them scrollable. I tryed adding a scroller to the text box, but when it resized it just wouldn't work. So I was thinking that maybe there was a way to put the actuall text box into something , and have IT scroll ! Once again, any input is GOOD input :) see ya's !

:b:

Garbage Donkey
September 16th, 2003, 01:38 PM
Is there a way to make that resized text object, or ANY object for that matter, scrolling. Could I put it inside of a movie clip and then make it scroll ? or would I have to do some other funky stuff ?