script help needed

how do i do this??

function Update () {
     animation.Play("Loading");
else if (animation))
     animation.Stop("Loading");
     Application.LoadLevel (1);
    }

it doesnt work at all it is suposed to play the loading animation and at that time preload sene 1 so it doesnt load it afther.can you please fix this for me thanks

You can't have an `else if` without an `if` for starters.

Also, preloading is done with `LoadLevelAsync()`. What your doing is loading the level which will freeze the current level.

So you probably want to do something more like:

function Start () {
     if(animation)  //is there and animation component on this object
          animation.Play("Loading");

     var async : AsyncOperation = Application.LoadLevelAsync (1);
     yield async; //Wait while the level is loading in the background

     Application.LoadLevel(1);
}