Actuate alpha problem the second time around

Trying the following:

Actuate.tween(TEXTOBARRA, 1, { alpha: 0 }, false).onComplete(background.removeChild, [TEXTOBARRA]);
Actuate.tween(barra, 1, { alpha: 0 }, false).onComplete(background.removeChild, [barra]);
Actuate.tween(loader, 1, { alpha: 0 }, false).onComplete(background.removeChild, [loader]);
Actuate.tween(loader1, 1, { alpha: 0 }, false).onComplete(background.removeChild, [loader1]);

makes it so the second time around, only TEXTOBARRA (wich is text) shows up, everything else also has alpha set to 1 but it only displays the first time.
Am I missing some other way to do this or is it a bug ? Is there a better way to make a layer fade and then remove it in a delayed way ?

Edit to add: making .alpha = 1 doesn’t help either, nothing shows up but the text. The loaders are re-loaded each time. I don’t get it.

Okay, so I see four tweens of the same pattern

Actuate.tween (clip, 1, { alpha: 0 }).onComplete (removeChild, [ clip ]);

If you want to make things visible (without an animation) again, you would probably want:

Actuate.apply (clip, { alpha: 1 });
addChild (clip);

Calling apply will cancel any active tweens, in case the object is still being animated out.

You’ll also need to addChild the object again

I believe Actuate automatically toggles the visible property when tweening a DisplayObject, which may be enough for performance. Perhaps you skip removeChild altogether?


No active tweens going on when re-calling the function that does this but added the apply tween just in case.
Stopped using the removeChild and still only text comes back the second time around.

Oh, you’ll also need to set visible = true

LMAO, I had just tried that and it worked then came here to say it was visible that I was missing, but you beat me to it. You’re solid singmajesty as always. Thank you.

1 Like