Since most tutorials on this are confusing, I created this template for others to use. Just copy it into your _root header, and call the functions from your main menu buttons.
var saveData:SharedObject = SharedObject.getLocal("XXsaveFileNameXX"); // use a unique file name like "starDustV1B12" so that other games will not overwrite it.
function restart(){
_root.saveData.clear();
//