Problem accessing vector properties

Hello guys, I'm new to Unity 3D and currently im working on a iphone project using unity javascript. I encountered this compile error: BCE0019: 'x' is not a member of 'Object'.

my codes are somewhat like this:

   #pragma strict

private static var pointsArray:Array ;

private static startGeneratePoints()
{
    pointsArray = new Array();
    var randomPoint:Vector3;

    for(var i:int = 0; i < 3; i++)
    {
        randomPoint = new Vector3(i,1,1);
        pointsArray.Push(randomPoints);
    }

print(pointsArray[0].x);

}

then i tried:

var tempVector2:Vector3 = pointsArray[0];

trying to assign it into a vector3, this is the error i get:

BCE0022: Cannot convert 'Object' to 'UnityEngine.Vector3'.

Then, i try to cast it to vector3:

var tempVector2:Vector3 = pointsArray[0] as Vector3;

this is the error i get:

BCE0006: 'UnityEngine.Vector3' is a value type. The 'as' operator can only be used with reference types.

Anyone got an idea on how to solve this issue? How can I get the 'x' properties of the vector3 inside an array?

Try add in

#pragma downcast

at the top of your file, which should allow it to implicitly (but not dynamically) cast to the right type

There's no reason to use Array. Use `List.` instead.