11 Replies Latest reply on Mar 5, 2010 2:18 PM by 2sidesdesign

    Action sequences - set component state doesn't work


      Maybe it's just me, but i can't seem to be able, through FC action sequences to set a components state, be it the main application or any other component within the main app. If anyone has any explanation PLZ send it to me!


      I have a flash intro and i wanted to change the state of my main app at the end of the swf. I've tryed creating a button, a simple shape, a custom component and still nothing....the option to set the state of a component remains disabled...


      PLZZ!!!! can anyone help me!?!?!??!

        • 1. Re: Action sequences - set component state doesn't work
          Tara Jane Feener Level 3

          Hey Joana,

          You can set a component state, through an action sequence using the following steps:


          1) Select your action sequence in the timeline panel.

          -For your case, since you have an intro video (is it a swf file or video?) you probably want to create an action sequence on 'Application Load'.  You can do this by selecting the artboard (white starting canvas) and in the interaction panel clicking Add Interaction followed by 'On Application Load'.  This action sequence will be triggered right when the application starts.

          2) Select the component whose state you'd like to change (on the artboard, in the layers panel).

          3) At the bottom of the timeline panel, click 'Add Action', following by 'Set Component State'.

          4) In the Properties Panel (bottom right), you can now select the component state in a dropdown.

          5) Alter the delay to choose when it starts.


          If your application has various states, ie intro, followed by a main view, you may want to consider creating a custom component with two states to achieve the above sequence.


          If your intro is a video, you can add an action sequence to trigger 'On video play complete', at which point you can change the state of the main custom component.


          Does this help? Let me know if you need further clarification.



          • 2. Re: Action sequences - set component state doesn't work
            JoanaBCunha Level 1

            I have an swf in the first state of my fxp project and i wanted to change to my second state when the swf reached a certain point.

            • 3. Re: Action sequences - set component state doesn't work
              2sidesdesign Level 1

              are you trying to switch to another "component state" or a different "page state"?

              • 4. Re: Action sequences - set component state doesn't work
                JoanaBCunha Level 1

                A "page state". I've understand what the set component state works for and with but it doesn't help me in what I want, still too used to flash's "freeness". I guess i'll have to keep on waiting for beta3 or the release version....thanks anyway

                • 5. Re: Action sequences - set component state doesn't work



                  I've built a custom component and I'd like for one of the states of that component to play for 5 seconds, then transition to another state. Is this possible (yet)?



                  • 6. Re: Action sequences - set component state doesn't work
                    Tara Jane Feener Level 3


                    Where you planning for a particular interaction to trigger this 5 second custom component display? (like on button click?)

                    Or did you want it to trigger when your application starts?

                    Let me know, it'll help me better answer your question.



                    • 7. Re: Action sequences - set component state doesn't work
                      rvlaha Level 1



                      Thanks for the quick reply.


                      Here's how it should work: clicking a "submit" button in state1 brings me to state2. I want state2 to fade in, show for 5 seconds, then fade to state3.



                      • 8. Re: Action sequences - set component state doesn't work
                        Tara Jane Feener Level 3

                        Hey, no problem!


                        So, here's what you have to do.


                        1) Select the submit button.

                        2) In the interactions panel, click 'add interaction', and select: On Click -> Play Action Sequence

                        3) Your action sequence will appear in the timeline panel.

                        4) On the artboard, select your custom component.

                        5) At the bottom of the timeline panel, is an option to 'Add Action'.  Note that clicking 'Add Action' applies an action to the currently selected object on the artboard.

                        6) Click 'Add Action', and select 'set component state'.

                        7) The properties panel on the bottom right, now shows a dropdown control where you can select your component state (in your case, select state 2).

                        8) Repeat steps 6, and 7, but select state 3 as the component state in the properties panel.

                        9) You should now see two bars in the timeline panel associated with your custom component.

                        10) Drag the second bar (the setComponentState: state 3) bar such that it is at the 5 second mark on the timeline panel.

                        11) Now when you click the submit button, your custom component will transition to state 2, and then five seconds later transition to state 3.


                        Does this work for you? Are the steps clear?


                        There is a potential problem.  If your submit button is a part of your custom component, you won't be able to set the state of the custom component (in step 6, set component state will be disabled).

                        This is because we don't allow you to control the state of a parent component by interacting with a child component.


                        Is your submit button inside your custom component, or outside?

                        The steps above describe a solution to this problem, with the submit button outside (not a part of your custom component).


                        Let me know how you make out, and if you have any further questions/problems.



                        • 9. Re: Action sequences - set component state doesn't work
                          2sidesdesign Level 1



                            As far as I can tell, action sequences can cause elements to change within the selected page state but not create a transition between 2 page states. I think it's semantics that are causing the confusion here.


                          Imagine I have a fxp file with 3 page states at the top:


                            SearchForm           Searching            SearchResults


                          And I want the desired flow:


                          1) User clicks a buton on the "SearchForm" page state and there is a transition to the "Searching" page state.

                          2) The "Searching" page is displayed for 5 seconds,

                          3) There is an automatic transition from the "Searching" page state to the "Search Results" page state


                          The transition from "SearchForm" to "Searching" is trivially easy; but, an action sequence will not be able to get you from "Searching"

                          to "Search Results" though.


                          The action sequence seems to allow a transition from on component state to another. For example, you have a form

                          and want it to display an error message. Instead of creating 2 page states, you could have the form have two component states

                          (Normal, error) and use an action sequence to transition between them. Note that this has nothing to do with the Page States

                          at the top of the app.


                          Hopefully this makes sense to someone else besides me!



                          • 10. Re: Action sequences - set component state doesn't work
                            Tara Jane Feener Level 3

                            Hey Rob!

                            Thanks for posting.

                            And yes, you're right, using page states, you can't achieve the workflow described.

                            To achieve the workflow described, you must do it with a custom component (where you can use the steps I listed above).
                            I described the problem situation you're describing above (not being able to target a parent, where in the case you're describing the application (page state) is the parent).


                            Is being able to manipulate transitions between pages an important Catalyst workflow for you?

                            And were you able to achieve this workflow using components (and setting component state)?

                            Let me know, I can be sure to send feedback to the right places



                            • 11. Re: Action sequences - set component state doesn't work
                              2sidesdesign Level 1



                              I create a lot of device prototypes, and having the ability to move between page/application states after a specified

                              time period comes up all the time.


                              To achieve this now I have to take FXP into Flash Builder and add timers manually. This is a drag because going into Builder

                              is a one-way street.


                              Even though you *can* achieve timed behavior using components, I think that approach will confuse most non-Flex experienced

                              designers. They are going to set up page/app states, and want to set up transitions between them. Thats what *all* the tutorials show,

                              it's what the app is mainly set up to do, and it's really easy to understand.


                              I have put a "timer component" idea on the ideas site. Hopefully it makes it in there one day.


                              Thanks for listening!