Intanto grazie:
Comunque da errore in
var k=1

Statement must appear within on/onClipEvent handler
var k = 1