all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

textformat(); with input text field problem



textformat(); with input text field problem Catungo
11/25/2004 9:37:21 PM
flash actionscript: Hi, ive dynamicly created an input textfield to wich im trying to apply a
textformat object, but when i test the movie it does not allow me to type any
text in the textfield, another point is that im using embedFonts so when i
create the textfield i set the property embedFonts to true, i noticed that when
i remove this line the textfield works fine, except that the textformat is not
a applied to it. here is the code: mcContact.createTextField('tInput1',
mcContact.getNextHighestDepth(), 98, 196, 200, 20); mcContact.tInput1.type=
'input'; mcContact.tInput1.maxChars= 20; mcContact.tInput1.embedFonts= true;
mcContact.tInput1.border= true; var inputForm:TextFormat = new TextFormat();
inputForm.font = 'FFF Harmony'; inputForm.size = 8; inputForm.color =
0x534531; mcContact.tInput1.setTextFormat(inputForm)
Re: textformat(); with input text field problem mandingo
11/25/2004 9:43:37 PM
Try using setNewTextFormat not just setTextFormat:

mcContact.tInput1.setNewTextFormat(inputForm)

I haven't looked entirely into the problem you are experiencing but that could
be a start point,

cheers,
Re: textformat(); with input text field problem Catungo
11/25/2004 11:28:02 PM
problem solved, thanks a lot for you help :),
can you just explain the diference between setNewTextFormat and setTextFormat.

Thnx
Re: textformat(); with input text field problem mandingo
11/25/2004 11:33:10 PM
If you look at the AS Dictionary, I think from memory it indicates that any
time you need to make dynamic changes to a textField and for any change to take
effect after the field has been initialised (which is the case in your runtime
creation) or if you are populating the field dynamically, then you should use
..setNewTextFormat...

I don't think I explained that very well... but it is in the AS Dictionary.

cheers,:)
Re: textformat(); with input text field problem Catungo
11/25/2004 11:53:20 PM
well thats a great help, and ill go into de AS help to learn more..
thanks
AddThis Social Bookmark Button