React to change on a static property

Posted by Stiggler on Stack Overflow See other posts from Stack Overflow or by Stiggler
Published on 2009-06-01T22:12:26Z Indexed on 2010/03/14 14:15 UTC
Read the original article Hit count: 349

Filed under:
|
|
|
|

I'm re-writing an MXML item renderer in pure AS. A problem I can't seem to get past is how to have each item renderer react to a change on a static property on the item renderer class. In the MXML version, I have the following binding set up on the item renderer:

instanceProperty={callInstanceFunction(ItemRenderer.staticProperty)}

What would be the equivalent way of setting this up in AS (using BindingUtils, I assume)?

UPDATE:
So I thought the following wasn't working, but it appears as if Flex is suppressing errors thrown in the instanceFunction, making it appear as if the binding itself is bad.

BindingUtils.bindSetter(instanceFunction, ItemRenderer, "staticProperty");

However, when instanceFunction is called, already initialized variables on the given instance are all null, which was the cause of the errors referenced above. Any ideas why this is?

© Stack Overflow or respective owner

Related posts about databinding

Related posts about static