Puff, lo de definir el formato en el prototype es una aut�ntica barbaridad.
Aqu� tienes una versi�n algo m�s coherente y sin nombres de variable
demasiado peligrosos:

<CODE>
TextField.prototype.asignarTextos = function(longitudMaxima) {
    if (!longitudMaxima) {
        var longitudMaxima = this.text.length;
    }
    if (!temporal_txt) {
        createTextField("__temporal_txt__",8, 200, 125, this._width,
this._height);
        __temporal_txt__.selectable = true;
        __temporal_txt__.wordWrap = true;
        __temporal_txt__.autoSize = false;
    }
    var primeraParte = this.text.substr(0, longitudMaxima);
    primeraParte = primeraParte.substr(0, primeraParte.lastIndexOf(" "));
    __temporal_txt__.text = primeraParte;
    __temporal_txt__.setTextFormat(this.getTextFormat());
    if (__temporal_txt__.maxscroll>1) {
        if (__temporal_txt__.maxscroll>2) {
            longitudMaxima =
primeraParte.length-(10*(__temporal_txt__.maxscroll-2));
        } else {
            longitudMaxima = primeraParte.length-2;
        }
        this.asignarTextos(longitudMaxima);
        return __mistextos__;
    } else {
        __temporal_txt__.removeTextField();
        var segundaParte = this.text.substr(primeraParte.length + 1);
        this.text = primeraParte;
        __mistextos__ = new Array(primeraParte,segundaParte);
        return __mistextos__;
    }
};
miTexto_txt.text = "esto es un texto de prueba para ver c�mo funciona el
overflow de texto utilizando texto plano"
textos = miTexto_txt.asignarTextos();
</CODE>

xxx

Eva

<!-------------------------------
Lista ASNativos:
subscripciones/desubscripciones
http://www.sidedev.net/asnativos
-------------------------------->

Responder a