Código ActionScript :
package
{
import flash.display.Sprite;
import flash.text.*;
import flash.text.TextFormat;
public class MostrandoTexto extends Sprite
{
private var txtCampo:TextField = new TextField();
private var myText:String = "Jesus Cristo";
public function MostrandoTexto()
{
showingText();
formatingText();
}
public function showingText():void
{
addChild(txtCampo);
txtCampo.text = myText;
}
public function formatingText():void
{
var fmt:TextFormat = new TextFormat();
fmt.align = "center";
fmt.bold = true;
fmt.font = "Verdana";
fmt.size = 20;
fmt.color = 0xFF0000;
myText.setTextFormat( fmt );
}
}
}
Pero cuando lo ejecuto el fla me devuelve este error:
Call to a possibly undefined method setTextFormat through a reference with static type String.
Alguien sabe dónde está el problema?
Desde ya muchas gracias.
