Class scripts errors

hi, again…

i’m using a component that uses a extenral AS file (FormValidator.as), and it was made in Flash MX (Flash Player 6 /ActionScript 1.0)
i need to used it with Flash MX 2004 (Flash Player 7 /ActionScript 2.0), and i get some errors.

the FormValidator.as code is:
[AS]
FormValidator = function () {
this.valide = false;
this.target_mc._visible = false;
};
FormValidator.instances = [];
FormValidator.id = 0;
FormValidator.submit = 0;
FormValidator.prototype = new MovieClip();
ASBroadcaster.initialize(FormValidator.prototype);
FormValidator.prototype.onLoad = function() {
FormValidator.id++;
this.init();
};
FormValidator.prototype.init = function() {
if (!_root.container_invalid) {
_root.createEmptyMovieClip(“container_invalid”,989);
}
this.t_mc = this._parent[this.targetInstanceName];
this.t_mc.parent = this;
this.id = FormValidator.id-1;
if (this.formType!=“submit”) {
this.t_mc.focusDefined=false;
FormValidator.instances.push({mc:this.t_mc,variableName:this.variableName,type:this.formType});
}
if (this.formType==“submit”) {
if (FormValidator.submit > 1) {
trace(“O formulário admite apenas uma submissão, consequentemente, este terminará a execução!”);
return false;
}
FormValidator.submit++;
this.addListener(this);
if (this.t_mc.onRelease!=null && !this.t_mc.oldOnRelease) {
this.t_mc.oldOnRelease = this.t_mc.onRelease;
}
this.t_mc.onRelease = function() {
this.oldOnRelease();
var tt = FormValidator.instances;
var l = tt.length;
for (var i=0;i<l;i++) {
tt*.mc.parent.validate(tt*.mc.parent.formType); *
}
this.parent.broadcastMessage(“onSubmit”);
}
}
};
FormValidator.prototype.validate = function(type_str) {
switch (type_str) {
case “input” :
this.valid = this.inputValidate();
break;
case “email” :
this.valid = this.emailValidate();
break;
}
if ((!this.valid) && (type_str != “submit”)) {
var x1 = this.t_mc._x;
var y1 = this.t_mc._y;
var w1 = this.t_mc._width;
_root.container_invalid.createTextField(“error”+this.t_mc._name, this.id, x1, y1, w1, 20);
var t = _root.container_invalid[“error”+this.t_mc._name];
var tf = new TextFormat();
tf.align=“right”;
tf.color = “0xB61212”
tf.font = “Verdana”;
tf.size = 10;
t.text = this.error_message;
t.selectable = false;
t.setTextFormat(tf);
if (!this.t_mc.focusDefined) {
if (this.t_mc.onSetFocus!=undefined) {
this.t_mc.oldFocus = this.t_mc.onSetFocus;
*} *
this.t_mc.onSetFocus=function() {
_root.container_invalid[“error”+this._name].removeTextField();
if (this.oldFocus) this.oldFocus();
}
this.t_mc.focusDefined = true;
*} *
return false;
}
return true;
}
FormValidator.prototype.inputValidate = function() {
if (this.t_mc.text != “”) {return true;} else {return false;}
}
FormValidator.prototype.emailValidate = function() {
var v = this.t_mc.text;
if (v != “”) {
var len = v.length;
*var validName = "abcdefghijklmnopqrstuvwxyz-
.0123456789";*
var validDomain = “abcdefghijklmnopqrstuvwxyz-0123456789”;
var validLast = “abcdefghijklmnopqrstuvwxyz”;
if ((v.charAt(0) == “@”) || (v.charAt(len-1)=="@") || (v.charAt(0) == “.”) || (v.charAt(len-1)==".")) {return false};
if ((v.indexOf("@") == -1) || (v.indexOf(".") == -1)) {return false;}
if (v.split("@").length>2) {return false};
if (v.split("@")[1].split(".").length>3) {return false};
var name = v.split("@")[0];
var domain = v.split("@")[1].split(".")[0];
var last = v.split("@")[1].split(".")[1];
for (var i=0;i<name.length;i++) {
*if (validName.indexOf(name.charAt(i))==-1) return false; *
}
for (i=0;i<domain.length;i++) {
*if (validDomain.indexOf(domain.charAt(i))==-1) return false; *
}
if ((domain.charAt(0)=="-") || domain.charAt(domain.length-1)=="-") return false
for (i=0;i<last.length;i++) {
*if (validLast.indexOf(last.charAt(i)) == -1) return false; *
}
return true;
} else {
return false; *
}
}
FormValidator.prototype.onSubmit = function() {
var t = FormValidator.instances;
var len = t.length;
var result = 0;
for (var i=0;i<len;i++) {
if (!t.mc.parent.valid) {

result++;
}
}
if (result>0) {
*_root[this.error_callbak].apply(null); *
}
if (result==0) {
var loadVar = new LoadVars();
loadVar.parent = this;
for (var j=0;j<len;j++) {
loadVar[t[j].variableName] = t[j].mc.text;
}
loadVar.onLoad = function() {
if (this.parent.callback!="") {
*_root[this.parent.callback].apply(null); *
}
}
ASSetPropFlags(loadVar,“onLoad”,1,1);
loadVar.sendAndLoad(this.cgiurl, loadVar, this.sendType);
}
}
Object.registerClass(“FormValidator”,FormValidator);
[/AS]

…and i get all these errors:

*
****Error** \FormValidator.as: Line 4: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 };*
 
***Error** \FormValidator.as: Line 6: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 FormValidator.__instances__ = [];*
 
***Error** \FormValidator.as: Line 7: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 FormValidator.__id__ = 0;*
 
***Error** \FormValidator.as: Line 8: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 FormValidator.__submit__ = 0;*
 
***Error** \FormValidator.as: Line 9: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 FormValidator.prototype = new MovieClip();*
 
***Error** \FormValidator.as: Line 10: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 ASBroadcaster.initialize(FormValidator.prototype);*
 
***Error** \FormValidator.as: Line 15: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 };*
 
***Error** \FormValidator.as: Line 47: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 };*
 
***Error** \FormValidator.as: Line 85: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 FormValidator.prototype.inputValidate = function() {*
 
***Error** \FormValidator.as: Line 88: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 FormValidator.prototype.emailValidate = function() {*
 
***Error** \FormValidator.as: Line 117: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 FormValidator.prototype.onSubmit = function() {*
 
***Error** \FormValidator.as: Line 144: ActionScript 2.0 class scripts may only define class or interface constructs.*
*	 Object.registerClass("FormValidator",FormValidator);*
*Total ActionScript Errors: 12 Reported Errors: 12*

…and i try to put the *.AS file in the classes folder… and i get the some errors:

Error C:\Documents and Settings\Tico\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\FormValidator.as: Line 4: ActionScript 2.0 class scripts may only define class or interface constructs.
};
etc…
etc…

can anyone help here this stuff? :frowning: