Your placemark
variable is null when you are trying to add the event handler.
At a guess either the url or id is wrong in the line
var placemark = ge.getElementByUrl('http://web.uniparthenope.it/~0124000489/tw-2013/place.kml#campania');
or else you are calling it before the kml dom has actually loaded and so the placemark can't be found.
To fix, try calling the placemark accessor and adding the event listener from within the event callback for the fetchKml operation.
Something like so.
var href = 'http://web.uniparthenope.it/~0124000489/tw-2013/place.kml'
google.earth.fetchKml(ge, href, fetchKmlCallback);
function fetchKmlCallback(kml) {
if(kml) {
ge.getFeatures().appendChild(kml);
var placemark = ge.getElementByUrl(href + '#campania');
google.earth.addEventListener(placemark, 'click', playTour);
}
}
function playTour() { /* handle playing here */ }
Looking at the KML in the link you provided there doesn't seem to be a <gx:Tour>
defined or linked to. So it is impossible to say how you should handle the playing part. It sounds like you want to load a complex tour (i.e. there will be more in the KML document than just a single <gx:Tour>
feature) so perhaps it would be best to read through the touring documentation for the the Api it clearly shows how to handle all this.