I would like to have text within a button blink/pulsate on and off. I know I can use AlphaAnimation
to achieve this effect, but from what I know this acts on the entire button view. Is there a way to implement this type of animation on just the text within the button?
Create a basic button. Choose Insert > New Symbol, or press Control+F8 (Windows) or Command+F8 (Mac OS). Note: In Flash 3 and earlier, deselect everything on the Stage and choose Insert > Create Symbol. In the Symbol Properties dialog box, enter a name for the new button symbol and choose Button as the Behavior option.
Use a css class for the animation and add the class to div when button clicked. (use @keyframes to define css animations.) Show activity on this post. Show activity on this post.
You could animate the text color from your standard color to transparent and back again
ObjectAnimator colorAnim = ObjectAnimator.ofInt(myButton, "textColor", Color.RED, Color.TRANSPARENT);
colorAnim.setDuration(1000);
colorAnim.setEvaluator(new ArgbEvaluator());
colorAnim.setRepeatCount(ValueAnimator.INFINITE);
colorAnim.setRepeatMode(ValueAnimator.REVERSE);
colorAnim.start();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With