how to use "as"

I read some tutorial.but didn't understand its usage.

GUITween temp = null;
temp = GameObject.Instantiate(guiTween) as GUITween;

what the different between with "as" and without "as",thank you!

First, you don't need to use "GameObject." Instantiate by itself works fine, as long as your class derives from Object, which is very likely the case.

To actually answer your question, the reason you need as is that Instantiate returns an Object, not a GUITween. So you need to tell Unity that you want that object to have all the power of a GUITween, not just that of an Object. You also want to be able to store the returned object as a GUITween. as does all of this.

Here is some more information about as.

For illustrate.

Try wrote "#pragma strict" on top of code. You will get error, if run code without "as". Because with "#pragma strict" it not supports dynamic cast between classes.