1 Reply Latest reply on Sep 18, 2009 11:45 AM by Tvoliter

    How Do You Set the State Of a Custom Compent's Child Custom Compent?


      I'm starting to build very complex interface 'widgets' built by taking simple custom compents and creating more complex custom compents from these compents and then again grouping those to create custom components. However, I'm starting to lose access in Catalyst to set these sub custom compents. It maybe just a noob issue.


      Am I looking at this wrong?

      Should I not be nesting compents?

      Other wise how do I access these?


      I haven't jumped into the code part of FLEX yet but I figured it would be very OOP like, so... (psuedo code)


      myParentCustomComponent.my1stChild.state = myChildsStateOn;

      //( myChildsStateOn, myChildsStateOff, myChildsStateNotVisited )


      myParentCustomComponent.my2ndChild.state = myChildsStateOn;

      //( myChildsStateOn, myChildsStateOff, myChildsStateNotVisited )



      I hope I can set this in Catalyst so that I don't have to do a shallow and very wide state setup like ... (psuedo code)


      myCustomCompent.state = my1stChildIsOn;

      myCustomCompent.state = my1stChildIsOff;

      myCustomCompent.state = my1stChildIsNotVisited;

      myCustomCompent.state = my2ndChildIsOn;

      myCustomCompent.state = my2ndChildIsOff;

      myCustomCompent.state = my2ndChildIsNotVisted;



      PLEASE ADVISE, thank you.



      Best Regards,


        • 1. Re: How Do You Set the State Of a Custom Compent's Child Custom Compent?
          Tvoliter Adobe Employee

          Hi Truce,

               Thank you for your feedback. You have run into a current limitation with the "play transition to state" interaction and the "Set Component State" action in the timeline. Currently the UI that allows you to pick a state only "sees" components that are direct children of your current context. The state picker doesn't allow picking states of components that are more deeply nested.


          We are aware of this issue and how it impacts user's ability to author more complex projects, so we are looking at ways to allow users to pick states deeper within the hierachy when creating interactions.

          One work around that works in *some* cases is to set the state of sub components in a parent component using the PI rather than using interactions.


          If you have a structure like this



              WidgetA (with state1 and state2)

                    WidgetB (with state1 and state2)

                    WidgetC (with state1 and state2)



          You can record what state WidgetB and WidgetC are in for each state of WidgetA. To do this double-click WidgetA, select WidgetB and change the current state in the properties editor for WidgetB. That state will be remember for each state of Widget A. Then when you have an interaction at the application level that changes the state of WidgetA, then WidgetB will change state as well. This works well if WidgetB is in the same state for each state of WidgetA. If you want to change WidgetB and WidgetC states directly from the Application level, there isn't currently a way to do this.


          - Ty