Question
Errors in compilation
I'm a newbie in Flash.
I met some compilation errors and hope one can help.
I used Flash 8 professional.
My FLA file involves a few AS files e.g. btn_Down.as. <--- Please see the code attached
When I compiled, all the errors are concerning "ActionScript 2.0 class scripts may only define class or interface constructs."
Please help. Thanks.
Here are the errors:
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 3: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.val = 1;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 4: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.ovr(_root.Val);
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 6: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageWidth = 1320;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 7: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageHeight = 938;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 8: ActionScript 2.0 class scripts may only define class or interface constructs.
var cnt:Number = 0;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 10: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioX:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 11: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioY:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 13: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.mouseSensor = true;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 14: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.goDest = false;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 39: ActionScript 2.0 class scripts may only define class or interface constructs.
};
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 3: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.val = 1;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 4: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.ovr(_root.Val);
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 6: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageWidth = 1060;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 7: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageHeight = 480;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 8: ActionScript 2.0 class scripts may only define class or interface constructs.
var cnt:Number = 0;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 10: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioX:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 11: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioY:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 13: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.mouseSensor = true;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 14: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.goDest = false;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 39: ActionScript 2.0 class scripts may only define class or interface constructs.
};
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 3: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.val = 1;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 4: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.ovr(_root.Val);
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 6: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageWidth = 1320;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 7: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageHeight = 938;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 8: ActionScript 2.0 class scripts may only define class or interface constructs.
var cnt:Number = 0;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 10: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioX:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 11: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioY:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 13: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.mouseSensor = true;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 14: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.goDest = false;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 39: ActionScript 2.0 class scripts may only define class or interface constructs.
};
I met some compilation errors and hope one can help.
I used Flash 8 professional.
My FLA file involves a few AS files e.g. btn_Down.as. <--- Please see the code attached
When I compiled, all the errors are concerning "ActionScript 2.0 class scripts may only define class or interface constructs."
Please help. Thanks.
Here are the errors:
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 3: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.val = 1;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 4: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.ovr(_root.Val);
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 6: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageWidth = 1320;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 7: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageHeight = 938;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 8: ActionScript 2.0 class scripts may only define class or interface constructs.
var cnt:Number = 0;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 10: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioX:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 11: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioY:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 13: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.mouseSensor = true;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 14: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.goDest = false;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Down.as: Line 39: ActionScript 2.0 class scripts may only define class or interface constructs.
};
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 3: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.val = 1;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 4: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.ovr(_root.Val);
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 6: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageWidth = 1060;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 7: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageHeight = 480;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 8: ActionScript 2.0 class scripts may only define class or interface constructs.
var cnt:Number = 0;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 10: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioX:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 11: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioY:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 13: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.mouseSensor = true;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 14: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.goDest = false;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_As.as: Line 39: ActionScript 2.0 class scripts may only define class or interface constructs.
};
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 3: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.val = 1;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 4: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.ovr(_root.Val);
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 6: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageWidth = 1320;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 7: ActionScript 2.0 class scripts may only define class or interface constructs.
var pageHeight = 938;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 8: ActionScript 2.0 class scripts may only define class or interface constructs.
var cnt:Number = 0;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 10: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioX:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 11: ActionScript 2.0 class scripts may only define class or interface constructs.
var ratioY:Number = 0.12;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 13: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.mouseSensor = true;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 14: ActionScript 2.0 class scripts may only define class or interface constructs.
_root.goDest = false;
**Error** C:\Documents and Settings\billy\桌面\flash_test\btn_Cust.as: Line 39: ActionScript 2.0 class scripts may only define class or interface constructs.
};
