Thanks but I'm now getting this error:
Map.as, Line 22 1084: Syntax error: expecting identifier before this.
For this line: currentObject.this = getChildByName(currentObject.name + "_target");