I have a simple UIComponent that is initialized when a Flex
applicaiton starts. The code is included here:
The TestUIComponent has an attribute "testValue" that is set
value the value of another object of type TestValue.
For some reason the testValue setter method is called twice
for UIComponent. It appears it is called once when the
TestUIComponent is initialized and a second time when the
"testValue" is bound.
Is this expected behavior? I have a different more complex
application, where calling the setter twice has a negative impact
on the application. Is there anyway around calling the setter twice
in this scenario?
I don't think you will be able to control how the framework
initializes your component, especially when using binding. You
could check for null, or set a flag or something else to control
your response to the setter call.