Locating Position of Object not Working?

I have a set path that my AI needs to follow.

The path is an array like so:

function GetPath() {
var path_objs : Array = pathGroup.GetComponentsInChildren(Transform);
	path = new Array();

	for (var path_obj : Transform in path_objs){
		if (path_obj != pathGroup)
			path [path.length] = path_obj;

I try to find the z position of the next point by:

var nextPathPointPosition = path[currentPathObj].transform.position.z;

and that doesn’t work.
I get the error : “BCE0019: ‘transform’ is not a member of ‘Object’.”

please help

You just need to cast:

var objTransform : Transform = path[currentPathObj];
var nextPathPointPosition = objTransform.position.z;

After reading your comment, I can suggest this approach:

var path = new List.<Transform>(pathGroup.GetComponentsInChildren.<Transform>());

Now you have all child transforms in a list, and you can iterate through them accessing position.z:

for (var i : int = 0; i < path.Count; i++)
    print(path_.name + ": " + path*.position.z);*_