6 Replies Latest reply on Jun 14, 2009 4:33 PM by faraxday

    Sub States


      I want to create a sub state in FC so that when I'm in a certain state, I can have sub states.


      Is this possible?

        • 1. Re: Sub States

          This might provide some insight.   "Flash Catalyst/Builder Screencast"  It's mostly about interactivity between FC and Flash Builder, but I picked up a few things regarding FC that were helpful.

          • 2. Re: Sub States
            loosepaint Level 1

            Here's how I created a sub-state.


            I had 3 images that I grouped (grouping is optional, you can just select the layers you want to use for the sub-state and they can be any layers, in any order, in separate groups) and then in the HUD click on the "Convert Artwork to Component" button and select "Custom/Generic Component".  This essentially collapses the selected layers.  Then you can edit the new sub-state and create duplicate or new blank sub-states (if you want), and for each sub-state you'll see a tab in the HUD.  I haven't tried it, but I'm guessing you could create sub-states within sub-states.  Maybe.


            It's the same process as creating a button.  Up, down, etc are all sub-states.


            One thing I realized today (unless I'm missing something) is that all states share the same layers.  FC will recognize and honor a layer that's turned off in one state, but not in another, but if you delete or add a layer, it's deleted or added for all states.


            That means that if you create a component out of certain layers, that component is a component in every state.  You can't have a component of layers in one state and then break the graphic apart in another.


            I feel like I want to be able to do that, but probably only because I don't get it yet.

            • 3. Re: Sub States
              njadobe2 Adobe Employee

              Hi--yes, that's the standard approach we recommend in FC for creating "sub-states": create a custom component out of your artwork, then create the states you need within that custom component.


              On your point about the layer structure needing to be the same, it would be great to understand if you have a use case where you'd commonly like to have a truly different structure in different states (as opposed to just having different sets of items visible or in existence in the different states).





              • 4. Re: Sub States
                loosepaint Level 1

                Regarding the layer structure - I think it was just a matter of working it out and understanding the concepts better.


                I had 3 pages, each a state.


                Each state has an identical menu with 3 buttons and each button transitions to one of the pages.


                When I'm on page1, I wanted to display the button for that page differently, so you could tell that you're on that page.  I ended up creating 3 images that I kept as graphics instead of buttons and then on the repspective page I turned on the graphic instead of the button for that page.


                If I duplicate layers in photoshop and bring that into FC, I can isolate each layer to a state by turning them on and off, so I don't think having a different layer structure for different states would provide any additional functionality.


                I think I realized that I need to do that work in Phototshop or AI before bringing it into FC.

                • 5. man
                  kp kp

                  I am trying to make a color configurator using Flash Catalyst, I created a few custom components, some of them contain the buttons (to choose the colors) and the others contain the masks that overlap the base picture. 

                  My app structure is:

                  Main stage (containing the base picture and the component1) > component1 (containing masks and component2) > component2 (buttons)

                  I need to reach the component1 from within the  component2 (_parent) and be able to change the stages, I am not sure thats currenty possible in FC so i am asking for advises or hints on how to do it in FB i suppose?


                  PS: I am a Flash Pro dev. trying to learn the FB&FC because i see good potential...



                  • 6. Re: Sub States
                    faraxday Level 1

                    That still doesnt solve my problem.


                    but i guess i will have to use tabs instead.