Calling a parent field in JSON within a foreach
===

I am probably missing something simple here but I feel it best to ask anyway.

I have the following code:

	$newarray = json_decode($jsoncode);
	$rad = 24;
	foreach ($newarray->objname as $obj)
	{
		echo "<map name='" . $mapname . "'>";
		echo "<area shape=\"circle\" coords='" . $obj->x . "," . $obj->y . "," . $rad . "' alt='" . $obj . "'>";
		echo '</map>';
	}

coming from a manually created json string:

    $jsoncode = '{"objname":{"Forest 1":{"x":120,"y":120},"Forest 2":{"x":434,"y":225}}}';

I am getting an error when trying to call the $obj variable to use within the foreach. Is there like something I have to add to make it show the name stored in the variable?

P.S. I have no problem with the rest of the code
	