20/7/11

TLFTextField getTextFormat Error 1009

Cuando hacemos lo siguiente puede que no arroje el siguiente error:
var tFormato:TextFormat = objEscritura.getTextFormat();
Lanza el siguiente Error 1009:
TypeError: Error #1009: No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo.
at fl.text::TLFTextField/getTextFormat()
 at bugs_fla::MainTimeline/frame1()
El problema parece ser la propiedad selectable. No tendremos el error si antes de hacer el get desactivamos y después volvemos a activar .
   
format.selectable = true; // enable
var format2:TextFormat = field.getTextFormat();
format.selectable = false; // disable

Fuente:
http://www.plasmik.com/blog/tlftextfield-bugs-hacks/

No hay comentarios:

Publicar un comentario