0 Replies Latest reply: Jun 16, 2010 1:15 AM by Bear Travis RSS

    FAQ: How do I get components to reset after changing pages / states?

    Bear Travis Adobe Employee

      Catalyst components remain in whatever state you left them, even if you switch to a page that does not contain them. For example, let's say you have scrolling text in Page 1 of your application and some artwork in Page 2 of your application. When you run your application, if you scroll the text, move on to Page 2, and eventually come back to Page 1, the text will be at the same scroll position as you left it. Sometimes, you want your application to reset the scrolling text (or another component) to an initial state whenever you change Pages or perform some other kind of "reset".


      To do this in Catalyst, you need to manually reset component states in the timeline.


      For a custom component, this is as simple as selecting the custom component in the ArtBoard, and the transition / action sequence in the Timeline you want to cause the reset. In the timeline, choose Add Action > Set Component State > (Default State).


      For scroll panels, it's a bit more difficult. Open up your Scroll Panel in edit in place. Select the scroll bar you use to scroll the content. In the Normal state, set the value property (Under Properties > Component) to 1, and in the Disabled state set it to 2. Exit Edit In Place. Select the Scroll Panel, and the transition / action sequence you would like to use to reset the panel. Choose Add Action > Set Property > Enabled > False. Choose Add Action > Set Property > Enabled > True. Move the second set property action to occur just after the first. This will toggle the enabled property, which will transition the scroll panel between the Disabled and Normal states, resetting the scroll bar thumb's position, and consequently resetting the scrolling content.


      There is a longer tutorial on this subject here.

      There is an example project attached that contains a custom component and a scroll panel.


      Answered By: Bear Travis

      See original discussion