You need to get the tk2dAnimatedSprite component.
tk2dAnimatedSprite sprite = trigger.gameObject.GetComponent<tk2dAnimatedSprite>();
sprite.Play(...)
If you need it to sparkle and then vanish, I suggest using a coroutine to play the animation, wait until it finishes, and then disable the gameObject. Something like this...
IEnumerator PlayStarAnimationAndVanish(GameObject target)
{
tk2dAnimatedSprite sprite = target.GetComponent<tk2dAnimatedSprite>();
sprite.Play("animation");
while (sprite.isPlaying())
{
yield return 0;
}
target.active = false;
}
and in your code,
StartCoroutine(PlayStarAnimationAndVanish(trigger.gameObject);
Also don't forget that you probably want to inhibit collisions as soon as the animation has started playing, as it will keep triggering again and again - you can do this by setting the collider to "none" on the frames of animation, or simply coding it in the coroutine above.
Hope that helps,
unikron