I have a FXG graphic asset in a Group container. It is invisible by default. When I try to fade in it works and fades in and fades out great the first time but the second time and 90% of the time after that it will show up immediately (not fade in) and then fades in on top of itself (if that makes sense).

I'm using Tweener so it may be tweener related issue but I have two other components that I'm fading in with it that do fade in correctly.

I'm guessing Tweener is taking a snapshot of each object at the time the tween starts and the FXG close button is visible (but alpha not applied) and then it fades from that image to the final image.

MXML:

<s:Image id="image" 
         left="20" top="80" 
         width="620" height="300" 
         useHandCursor="true"
         buttonMode="true"
         backgroundColor="black"
         backgroundAlpha="1"
         click="handleClick(event)"/>

<fxg:RoundCloseButton id="closeImageButton" width="24" height="24" top="82" right="22" 
                      useHandCursor="true"
                      buttonMode="true"
                      click="handleClick(event)"/>

Code:

image.alpha = 0;
image.visible = true;

closeImageButton.alpha = 0;
closeImageButton.visible = true;

imageExistsLabel.alpha = 0;
imageExistsLabel.visible = true;

Tweener.addTween([image, imageExistsLabel, closeImageButton], {alpha:1.0, time:0.25, transition:"easeOutExpo", delay:0.5});
有帮助吗?

解决方案

It seems to be related to the delay property. If I remove the delay it fades in correctly.

Tweener.addTween([image, imageExistsLabel, closeImageButton], {alpha:1.0, time:0.25, transition:"easeOutExpo", delay:0});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top