Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Text Field Not Displaying

Participant ,
Sep 26, 2015 Sep 26, 2015

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?

TOPICS
ActionScript
263
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Sep 26, 2015 Sep 26, 2015

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

Translate
Participant ,
Sep 26, 2015 Sep 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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 26, 2015 Sep 26, 2015
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines