• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Errors in compilation

New Here ,
Oct 02, 2006 Oct 02, 2006

Copy link to clipboard

Copied

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.
};
TOPICS
ActionScript

Views

768

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 02, 2006 Oct 02, 2006

Copy link to clipboard

Copied


"billywhy" <webforumsuser@macromedia.com> wrote in message
news:efsrl8$sdh$1@forums.macromedia.com...
> 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.

How are you *including* the AS files?


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2006 Oct 02, 2006

Copy link to clipboard

Copied

do you have a btn_Down class? or are you using an include statement to load your as file?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 24, 2019 Jun 24, 2019

Copy link to clipboard

Copied

Randomly out of nowhere the type tool stops working. It's not a particular set of steps that trigger it but anything randomly makes the type tool freeze. I have to restart the application all over again to make it work - which is as annoying as it sounds.

Please provide some help or support regarding this.

Thanks,

L

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 25, 2019 Jun 25, 2019

Copy link to clipboard

Copied

Hi, try uninstalling and installing Adobe XD again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 05, 2019 Dec 05, 2019

Copy link to clipboard

Copied

I'm having this same problem. I tried to reinstall and it didn't work.

The issue is really annoying, it's happening repeatedly and I have to close and reopen XD over and over. =/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

Let us know if the above solution worked, or if you still need assistance.

Thanks,

Preran

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 08, 2019 Dec 08, 2019

Copy link to clipboard

Copied

LATEST

Preran, I don't understand. The issue on type tool I and lipi_artist were talking about is in Adobe XD. The conversation was moved to a Flash discussion from 2006? I tried to understand the conversation to see if there is a relation and don't see how to use it on solving type issue on XD.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 02, 2006 Oct 02, 2006

Copy link to clipboard

Copied

Attached is my btn_Down.as file.
I used an include statement to load it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2006 Oct 02, 2006

Copy link to clipboard

Copied

show your include statement. (and you can't attach files here.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 02, 2006 Oct 02, 2006

Copy link to clipboard

Copied

#include "btn_Down.as"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 03, 2006 Oct 03, 2006

Copy link to clipboard

Copied

there's something other than the code you've posted here causing that problem. are you sure the code for btn_Down.as is accurately posted here?

is it possible that you have two btn_Down.as files in two different directories? is your flash html and swf in the same folder? if they are in different folders, are there two different btn_Down.as files in those folders?

if you're still having problems after reading the above, post a link to your fla and your .as file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2006 Oct 04, 2006

Copy link to clipboard

Copied

Thanks for your reply.

I'm sure the code is correct and there is no other btn_Down.as.

Is there any setting which I may neglect?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 04, 2006 Oct 04, 2006

Copy link to clipboard

Copied

I tried this code and wont find any error. it may that your .fla file has corrupted.
// --- btn_Down .. ------------------------------------------------------------

_root.val = 1;
_root.ovr(_root.Val);

var pageWidth = 1320;
var pageHeight = 938;
var cnt:Number = 0;

var ratioX:Number = 0.12;
var ratioY:Number = 0.12;

_root.mouseSensor = true;
_root.goDest = false;

this.btn_Down.onEnterFrame = function () {
trace("working ")
cnt++;
if(cnt%2 == 0) { // %翱骯濠蒂 檜辨 enterFrame擊 fps / 4
if (_root.mouseSensor) {
destX = pageWidth / 2 + (pageWidth / 2 - _xmouse) * ratioX;
destY = pageHeight / 1.5 + (pageHeight / 2 - _ymouse) * ratioY;

dX = destX - this._x;
dY = destY - this._y;
this._x = this._x + dX * 0.1;
this._y = this._y + dY * 0.1;
}

if (_root.goDest) {
dX = destX - this._x;
dY = destY - this._y;
if (Math.abs(Math.round(dX)) == 0 && Math.abs(Math.round(dY)) == 0) {
_root.goDest = false;
}
this._x = this._x + dX * 0.200000;
this._y = this._y + dY * 0.200000;
}
}
};

// ------------------------------------------------------------------------------
make sure your "btn_Down" is a movieClip and you are not using ";"
after #include "btn_Down.as"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2006 Oct 04, 2006

Copy link to clipboard

Copied

Thanks for the replies from all of you.

To be honest, all the FLA and AS are from someone.
I'm sure the they are correct and it needs not to change anymore.

However, I need to edit some animation in the flash.
Unfortunately, before editing, I tried to compile but I failed.

Because I can't contact with that person anymore, I need to work out myself.

It seems something other than the FLA and AS which cause the errors.
Is there any procedures in compilation which I may neglect?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2006 Oct 04, 2006

Copy link to clipboard

Copied

post a link to your .as and .fla files.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines