This is currently not as easy in Flash Catalyst as we'd like, but it can be done.
The standard way to do this is to place your graphic inside a custom component, and give the component two states: invisible and visible. Then your toggle button can toggle the component's state back and forth -- changing the "When in Any State" dropdown to make it do different things depending on whether the component is currently visible or not.
In other words, you'd add:
- On Click > Play Transition to State > Visible > When in Invisible
- On Click > Play Transition to State > Invisible > When in Visible
This has a downside: in Flash Catalyst CS5, putting the graphic inside a component means you can't have it resize in different states of your overall app. This is not an issue in the next version of Flash Catalyst (codenamed "Panini"), where you can create fully resizable components.
In the meantime you can work around this restriction with a little trickery -- this is messy but works like a charm. You can use a hidden custom component to store the visible/invisible state that your interactions look at (as above), and keep the graphic itself outside the component.
So, instead of the above, you'd add:
- On Click > Play Action Sequence > When in Invisible
- In the first action sequence, select the graphic and choose Add Action > Fade, and set it to go from 0 to 100.
- Then also a Set Component State action to set your hidden component's state to Visible
- On Click > Play Action Sequence > When in Visible
- In the second action sequence, select the graphic and choose Add Action > Fade, and set it to go from 100 to 0.
- Then also a Set Component State action to set your hidden component's state to Invisible
Hope that helps!
Peter, Thanks a million! That worked like a charm. I was trying to conceptualize some kind of controller before, but this hidden component is great! (and really not that messy). This is actually opening some other idea-doors now. Thanks again for the fast solution Z
No problem, glad I could help!
This worked alright at first, but now when I'm changing some things later down the line, my file seems to be missing connections between those buttons when I go to preview. Even though everything is set up correctly, it is now very inconsistent to run correctly. I did some previous changes to some buttons set up this way, and i had to delete the little empty reference object and redo all of the action sets, etc to get it running correctly again. Are things like this going to be updated any time soon?