resource.set_sound
is not used on a sound component, but on the resource of a sound component. So you need:
resource.set_sound(go.get("/game#sound", "sound"), sfx)
resource.set_sound
is not used on a sound component, but on the resource of a sound component. So you need:
resource.set_sound(go.get("/game#sound", "sound"), sfx)