How to attach script to an instantiated object?

Hi all,

I have an object. On click and drag i should instantiate that object and make the instantiated object move along with the mouse cursor. I have the following code. I am attaching it only to the object. So only the main object is moving. But i want the instantiated object to move. Can anyone help me?

var newObject : Transform;
private var depth = 5;
function Update()
{
	x = Input.mousePosition.x;
	y = Input.mousePosition.y;
	Debug.Log("x:  "+x+"y:  "+y);
}
function OnMouseDown()
{
Instantiate(newObject,transform.position,transform.rotation);
}

function OnMouseDrag()
{
transform.position = camera.main.ScreenToWorldPoint (Vector3 (x, y, depth));
}

just use blabla.AddComponent("name of the component I want to add"); to add a component to a script instantiated game object

I tried the following. It gave out an error.

//private var scriptRef : JavaScript;
private var scriptRef : dragScript;//dragScript is the name of the script which i need to attach.
newObject.AddComponent(scriptRef);

And the following code only attaches the script to the instantiated object. If i instantiate an object, all the properties are automatically inherited (Instantiating is duplicating an object).

In my case, how to make the instantiated object to move along with my cursor instead of the original object?