Copy link to clipboard
Copied
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?
1 Correct answer
Never mind. My height and width were not set correctly and the field was underneath my background. Sorry!
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
Never mind. My height and width were not set correctly and the field was underneath my background. Sorry!

