ASScope classScope = ((ClassDefinition)c).getContainedScope();
IDefinitionSet definitionSet = classScope.getLocalDefinitionSetByName(propertyName);
if (definitionSet != null)
{
IDefinition winner = null;
int n = definitionSet.getSize();
for (int i = 0; i < n; i++)
{
IDefinition definition = definitionSet.getDefinition(i);
// Look for vars and setters, but not getters.
// Remember that getters and setters implement IVariableDefinition!
if (definition instanceof IVariableDefinition &&
!(definition instanceof IGetterDefinition))
{
// TODO Add namespace logic.
// Can MXML set protected properties?
// Can MXML set mx_internal properties if you've done
// 'use namesapce mx_internal' in a <Script>?
winner = definition;
final INamespaceReference namespaceReference = definition.getNamespaceReference();
final INamespaceDefinition thisNamespaceDef = namespaceReference.resolveNamespaceReference(this);
final boolean isBindable = ((NamespaceDefinition)thisNamespaceDef).getAETNamespace().getName().equals(
BindableHelper.bindableNamespaceDefinition.getAETNamespace().getName());
// if we find a setter always take it, otherwise
// keep looking for a setter