Skip to main content
Inspiring
September 26, 2015
Answered

Text Field Not Displaying

  • September 26, 2015
  • 1 reply
  • 307 views

I have some code on the timeline of my .fla file which adds a textfield when a function is called.

function healthCreateB():void{

  var hyperbenHP:TextField = new TextField();

  hyperbenHP.embedFonts = true;

  stage.addChild(hyperbenHP);

  trace(hyperben.HPT);

  hyperbenHP.x = 173

  hyperbenHP.y = 138

  hyperbenHP.text = 'banana'

  hyperbenHP.defaultTextFormat = new TextFormat('Arial', 12, 0xFFFFFF);

}

This function is called from a movieclip which has var HPT:uint = 100000.

The trace statement puts this out but the text is nowhere to be seen. If I move the mouse around the stage I can't even find a place where the cursor changes to the I cursor.

What am I doing wrong?

This topic has been closed for replies.
Correct answer mcdermitt

Never mind. My height and width were not set correctly and the field was underneath my background. Sorry!

1 reply

mcdermittAuthor
Inspiring
September 26, 2015

By the way 'banana' is a test word I use and I used it to test if the field was there. I also use String(hyperben.HPT);

mcdermittAuthorCorrect answer
Inspiring
September 26, 2015

Never mind. My height and width were not set correctly and the field was underneath my background. Sorry!