hi.
maybe i could see your code? the way you describe your problem, everything seems to be right.
it should look something like this:
func _on_AnimationPlayer_animation_finished("walk"):
get_tree().change_scene("main.tscn")
pass # Replace with function body.
(thats just an example)