not working- GameObject.GetComponent(MeshFilter).mesh;

EDIT-it seems I was testing on some crudely imported prefabs that have a visible mesh but they don’ t have the mesh-filter ar a mesh-renderer. SORRY!

original question-I need to get the mesh bounds (i.e. real size) of an instantiated object.

it returns null reference exception when I ask for GameObject.GetComponent(MeshFilter).mesh; after instantiating it.
I can Instantiate and rescale the object but I can’ t get it’ s Mesh.

Here is the code

    		for (var aa:int = 0; aa < 9; aa ++){
    			var r  : Quaternion; r.eulerAngles =;
    			var	k  = Camera.main.ViewportToWorldPoint (Vector3 (aa*.1+.1,.05, 1));
    			var prefabline = Instantiate(myprefabs[aa], k, r);
    			var mesh : Mesh = prefabline.GetComponent(MeshFilter).mesh;
    			var bounds : Bounds = mesh.bounds;
    			prefabline.transform.localScale = prefabline.transform.localScale*.1/bounds.size.x;

perhaps the Mesh has not been instantiated so I need a yield instruction?
is it possible for me to get the Mesh of a Prefab? I already tried:

 var mesh : Mesh = myprefabs[aa].GetComponent(MeshFilter).mesh;

hold why do you have the .mesh extension after using GetComponent
that shouldnt be there as far as I know
and ive done things like this before

oh and as a type you said Mesh but in GetComponent you MeshFilter
choose which type you are getting
a Mesh or MeshFilter

simply try
var mesh : MeshFilter = prefabline.GetComponent(MeshFilter);

sorry i keep having to edit this