Hi, thanks for your help but it still isn't working.
I tried it with a class extending TextField also and it didn't work.
here's the new code:
ActionScript Code:
package {
import flash.events.*;
import flash.display.Sprite;
import fl.controls.Label;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.display.Stage;
import flash.text.TextFormat;
public class Overlay extends Label {
public function Overlay(){
super();
addEventListener(Event.ADDED_TO_STAGE, onAdded);
autoSize = TextFieldAutoSize.LEFT;
var format:TextFormat = new TextFormat();
format.font = "Arial";
format.color = 0xFFFFFF;
format.size = 12;
format.underline = false;
textField.defaultTextFormat = format;
textField.backgroundColor = 0x000000;
}
private function onAdded(evt:Event){
textField.width = stage.stageWidth;
textField.height += 4;
trace(textField.width + " "+ stage.stageWidth ); // traces "280 550" but the label still appears only as wide as its text
}
}
}
I'm just accessing the label component's textField, right? the textField width traces 280 even though I've set it to 550 with stage.stageWidth
Thanks