This worked:
But this didn't:private var _boundProperty : String;
[Bindable( "namedBindable" )]
public function get boundProperty() : String
{
return _boundProperty;
}
public function set boundProperty( value : String ) : void
{
_boundProperty = value;
dispatchEvent( new Event( "namedBindable" ) );
}
It turns out that if you use PropertyChangeEvent Flex is a bit picky and doesn't use it for binding unless you populate the property property!private var _boundProperty : String;
[Bindable( "namedBindable" )]
public function get boundProperty() : String
{
return _boundProperty;
}
public function set boundProperty( value : String ) : void
{
_boundProperty = value;
dispatchEvent( new PropertyChangeEvent( "namedBindable" ) );
}
Like this:
This seems a bit odd to me as just a plain event works fine with no additional properties. Anyway, hopefully this blog post will stop anyone else wasting time investigating this problem.
private var _boundProperty : String;
[Bindable( "namedBindable" )]
public function get boundProperty() : String
{
return _boundProperty;
}
public function set boundProperty( value : String ) : void
{
_boundProperty = value;
dispatchEvent(
new PropertyChangeEvent(
"namedBindable",
false, false,
PropertyChangeEventKind.UPDATE,
"boundProperty"
) );
}