0
Tweenerでアルファ0からアルファ1にフェードするために自分のテキストフィールドを取得することに苦労しています。 それ以外はうまく動作するので、テキストフィールドにtextformatsを適用することと関係がありますか?Tweenerはアルファでフェードアウト
この私のコードです
プライベート関数swapText(E:イベント):無効{
applyTextFormats();
addChild(_textContainer);
var textfromx:int = _xmlData.image[_currentActiveSlide].textfromx;
var textfromy:int = _xmlData.image[_currentActiveSlide].textfromy;
var textendx:int = _xmlData.image[_currentActiveSlide].textendx;
var textendy:int = _xmlData.image[_currentActiveSlide].textendy;
_textTimer.stop();
var texteffectDuration:uint = _xmlData.image[_currentActiveSlide].texteffectduration;
var texteffectType:int = _xmlData.image[_currentActiveSlide].texteffecttype;
_effectDelay = _xmlData.image[_currentActiveSlide].effectdelay;
if(texteffectType == 1) {
_textContainer.x = textfromx;
_textContainer.y = textfromy;
Tweener.addTween(_textContainer, { x:textendx, y:textendy, time:texteffectDuration, onComplete:function() { _slideTimer.start(); } });
}
else {
_textContainer.alpha = 0;
_textContainer.x = textendx;
_textContainer.y = textendy;
Tweener.addTween(_textContainer, { alpha:1, time:texteffectDuration, onComplete:function() { _slideTimer.start(); } });
}
}
private function applyTextFormats():void {
_textContainer.text = _xmlData.image[_currentActiveSlide].imgtext;
_textContainer.width = _imgWidth;
_textContainer.height = 40;
_formatsText.size = _xmlData.image[_currentActiveSlide].fontsize;
_formatsText.align = TextFormatAlign.CENTER;
_formatsText.color = _xmlData.image[_currentActiveSlide].fontcolor;
_formatsText.font = [email protected];
if (_xmlData.image[_currentActiveSlide].fontbold == 1) {
_formatsText.bold = true;
}
else { _formatsText.bold = false; }
_textContainer.setTextFormat(_formatsText);
}