Comunidad de diseño web y desarrollo en internet online

Problema al actualizar un TextField

Citar            
MensajeEscrito el 28 Sep 2009 08:49 am
Hola a todos, tengo el siguiente problema, a ver si entre todos lo podemos solucionar.
Tengo un TF (creado dinámicamente) al cual le asigno un texto cuando lo creo, pero quiero que cuando pulse un botón, el texto del TF se modifique por otro. La questión es que cuando lo hago el valor del TF me lo actualiza pero no me lo muestra, es decir, parece como si el campo .text = ""; Pero si hago trace(myTF.text) me saca el valor que tiene que tener. alguien sabe porque? como puedo solucionarlo?

Os adjunto el trozo de código para que podais entenderlo mejor.

Código ActionScript :

private function createItems():void{
question1_txt = new TextField();
question1_txt.text = "HOLA";
question1_txt.x = 0;
question1_txt.y = 40;
question1_txt.width = 450;
question1_txt.height = 50;
question1_txt.multiline = false;
question1_txt.wordWrap = true;
question1_txt.selectable = false;
question1_txt.setTextFormat(questionFormat);
interviewCont_mc.addChild(question1_txt);

container_mc.addChild(interviewCont_mc);
this.addChild(container_mc);


mc1.graphics.beginFill(0x000000, 0);
mc1.graphics.drawRect(390, 360, 10, 20);
mc1.graphics.endFill();
mc1.useHandCursor = true;
mc1.buttonMode = true;
mc1.addEventListener(MouseEvent.CLICK, numClicked);
container_mc.addChild(mc1);
}

private function numClicked(e:mouseEvent):void{
question1_txt.text = "ADIOS";
//trace(question1_txt.text); == ADIOS
//pero no me muestra nada en el Stage
}


Muchas gracias a todos por vuestro tiempo
Manel

Por Pimager

38 de clabLevel



 

firefox
Citar            
MensajeEscrito el 28 Sep 2009 09:00 am
Ya lo solucioné, resulta que tenia que volver a aplicarle el TextFormat, sino me pintaba en negro y al ser fondo negro no se veia.

Muchas gracias a todos por su tiempo

Manel

Por Pimager

38 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.