Hi,
I am trying to find out how I can set properties on a
component from outside the component. This has been a constant
problem of mine that I am sure can be easily solved by someone more
knowledgeable.
I have a remote object call and in the result handler I want
to do something like :
var contactAccordion:Button = accordion.getHeaderAt(1);
contactAccordion.enabled = true;
In my view component that I created I have this :
%26lt;mx:Accordion id=''accordion'' creationPolicy=''all''%26gt;
%26lt;/mx:Accordion%26gt;
When my view component, the one with the accordion in it is
shown, initially when the screen is displayed I set the all
accordion panels to disabled via the creationComplete() except the
first one which is shown by default. Once I get the result back
from my Remote Object call, I want to enable a specific panel for
example.
How can I get a referecne to the ''Accordion'' from outside of
it? I am using Cairngorm 2.1 here, but if someone can assist me, I
figure I can get it to work within Cairngorm, my problem just seems
to be how does one reference a component outside of the actual
component.
Help highly appreciated as always.
-Westside
Set property on component from outside...
Do you mean you want to reference the Accordion control from
outside of the container where it is a child? Or do you mean you
want to reference the Accordion's children?
I'll assume you mean the former. The id gives the control its
identifier and it is automatically public. So you can just do:
container.accordion to reference it.
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment