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)
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,
problem solved, thanks a lot for you help :), can you just explain the diference between setNewTextFormat and setTextFormat. Thnx
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,:)
well thats a great help, and ill go into de AS help to learn more.. thanks
Don't see what you're looking for? Try a search.
|