Ultimate Gear War
Join the alien war, prepare your gear and protect your base at all cost!
4.23 / 5.00 14,223 ViewsI 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?
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.
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
At 7/4/12 10:52 AM, Knight52 wrote:At 7/4/12 10:42 AM, Attila0413 wrote:How do I set the language? I'm using Flash CS5.5
Yes you can, but you cannot mix AS2 and AS3 and you need to set the language you're using in your project.
Publish Settings -> Flash -> Script
Or while you create your project
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?
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.
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.
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?
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.
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.
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.