Flash AS3 Error 1152: a conflict exists with inherited definition in namespace public

ActionScript3 Error 1152: a conflict exists with inherited definition in namespace public

Description:
This ActionScript 3 error is confusing by description but easy to solve. This error will show up when you have one or more names that are duplicated from a  Flash/Flex object to a variable within a class. The conflict error 1152 is referencing is between a variable in your class and an instance on the stage.

Fix:
To fix AS3 Error 1152 just change the name of a variable to something other than the name of a button or movieClip on the stage. (You can also change the name of the button to resolve ActionScript Error 1152) Basically make sure the names don’t match or you will keep getting AS3 Error 1152.

Bad Code:

Button on Flash stage named “isPlaying”

//ActionScript3 code that uses the same name as a variable
private var isPlaying:Boolean = false;

Good Code:

Button on Flash stage named “isPlaying”

//ActionScript3 code that uses the same name as a variable
private var isPlayingNow:Boolean = false;

AS3 Error 1152 is a confusing AS3 error message, but a very easy fix.

As always Happy Flashing

Curtis J Morley