Credo che stai tentando di usare quel codice che è as3 su un documento Flash as2.