I have a TextField inside a Sprite and I always want the alpha of the TextField to be equal to the alpha of the sprite. How can i subscribe to the changes made in the Sprite? I guess i need to fire a PropertychangeEvent some how, but I can't see that sprite supports this out of the box?
class TextWidget extends Sprite{
private var textfield:TextField;
public function TextWidget(){
textfield = new TextField();
textfield.alpha = this.alpha; //does'n help
addChild(textField);
??
this.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, updateAlpha);
??
}
private function updateAlpha(event:PropertychangeEvent):void{
textfield.alpha = this.alpha;
}
}