[ActionScript 3] code in main TL

  • 352 Views
  • 10 Replies
New Topic Respond to this Topic
Knight52
Knight52
  • Member since: Jan. 8, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
[ActionScript 3] code in main TL Jul. 4th, 2012 @ 10:19 AM Reply

I have some experience on ActionScript 2 and just moved to ActionScript 3. When I tried to insert any code into main timeline, this error will show up

Scene 1 1152: A conflict exists with inherited definition flash.display:DisplayObject.mask in namespace public.

Any code, even trace(), will make this error occur. What happened? I can't put code in main timeline?

Attila0413
Attila0413
  • Member since: Dec. 10, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to [ActionScript 3] code in main TL Jul. 4th, 2012 @ 10:42 AM Reply

At 7/4/12 10:19 AM, Knight52 wrote: I have some experience on ActionScript 2 and just moved to ActionScript 3. When I tried to insert any code into main timeline, this error will show up

Scene 1 1152: A conflict exists with inherited definition flash.display:DisplayObject.mask in namespace public.

Any code, even trace(), will make this error occur. What happened? I can't put code in main timeline?

Yes you can, but you cannot mix AS2 and AS3 and you need to set the language you're using in your project.


BBS Signature
Knight52
Knight52
  • Member since: Jan. 8, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to [ActionScript 3] code in main TL Jul. 4th, 2012 @ 10:52 AM Reply

At 7/4/12 10:42 AM, Attila0413 wrote:
Yes you can, but you cannot mix AS2 and AS3 and you need to set the language you're using in your project.

How do I set the language? I'm using Flash CS5.5

Attila0413
Attila0413
  • Member since: Dec. 10, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to [ActionScript 3] code in main TL Jul. 4th, 2012 @ 11:59 AM Reply

At 7/4/12 10:52 AM, Knight52 wrote:
At 7/4/12 10:42 AM, Attila0413 wrote:
Yes you can, but you cannot mix AS2 and AS3 and you need to set the language you're using in your project.
How do I set the language? I'm using Flash CS5.5

Publish Settings -> Flash -> Script

Or while you create your project


BBS Signature
Knight52
Knight52
  • Member since: Jan. 8, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to [ActionScript 3] code in main TL Jul. 4th, 2012 @ 12:36 PM Reply

It's already ActionScript 3.0, so that's not the problem.
Now I've just found out EVEN comments will occur the error -_- is it possible that ActionScript 2 somewhere else in the project cause the problem?

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Supporter
Level 10
Programmer
Response to [ActionScript 3] code in main TL Jul. 4th, 2012 @ 12:40 PM Reply

What's the line of code that the error is on?

If you're using AS3 it's probably a bad idea to use Flash CS, look up FlashDevelop and use it with FlexSDK if you're serious about it.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature
Knight52
Knight52
  • Member since: Jan. 8, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to [ActionScript 3] code in main TL Jul. 4th, 2012 @ 01:01 PM Reply

At 7/4/12 12:40 PM, MintPaw wrote: What's the line of code that the error is on?

If you're using AS3 it's probably a bad idea to use Flash CS, look up FlashDevelop and use it with FlexSDK if you're serious about it.

Anything I put in the main timeline causes the error, even empty comment block (/**/).
And I have to use Flash as the project will be on tablet pc.

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 25
Programmer
Response to [ActionScript 3] code in main TL Jul. 5th, 2012 @ 03:50 AM Reply

At 7/4/12 10:19 AM, Knight52 wrote: Scene 1 1152: A conflict exists with inherited definition flash.display:DisplayObject.mask in namespace public.

Somewhere within your fla or in a class you named something "mask" and that's the issue. Get rid of that (rename it)
Have a look at your instance names!

Any code, even trace(), will make this error occur.

What happens if you put no code on the timeline?

Knight52
Knight52
  • Member since: Jan. 8, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to [ActionScript 3] code in main TL Jul. 5th, 2012 @ 05:37 AM Reply

At 7/5/12 03:50 AM, milchreis wrote:
What happens if you put no code on the timeline?

It can compile, and it shows run-time error from the code I'm not working on yet( something about sound). That's why I think it's not about instance name.

Knight52
Knight52
  • Member since: Jan. 8, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to [ActionScript 3] code in main TL Jul. 6th, 2012 @ 12:31 PM Reply

Turned out there WAS something named 'mask'. I changed its name, and it works now. Still wonder why could it compile when I didn't put any code in main timeline though.

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Supporter
Level 10
Programmer
Response to [ActionScript 3] code in main TL Jul. 6th, 2012 @ 12:34 PM Reply

At 7/6/12 12:31 PM, Knight52 wrote: Turned out there WAS something named 'mask'. I changed its name, and it works now. Still wonder why could it compile when I didn't put any code in main timeline though.

It's because mask is a property already, it's like calling a MovieClip "width" or "this" it's going to create a namespace conflict because object cannot be referenced.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature