How to i make a script that allows me to click on a 3d text and make a camera play an animation

My script is:

function OnMouseUp () {

animation.Play("To Instructions");

} What happens is it tries to make the 3d text do the animation instead of the camera

it needs to be:

animation.Play("To Instructions");

Animation is the class, animation is the way to access the component on the current object

Edit to satisfy your edit:

Camera.main.animation.Play("To Instructions");

or alternatively:

var cam : Camera;  //this goes at the top of your script, and you drag your camera into it in the inspector

cam.animation.Play("To Instructions");  //this goes in OnMouseUp