si sei stato chiaro, ma quello che hai postato è codice ActionScript, non javascript...