0 Replies Latest reply on Aug 30, 2012 10:04 AM by bandai07

    States problem

    bandai07

      Hi everybody,

       

      I'm kinda new to Flex and I currently have a problem with my states. I hope that someone can help me.

       

      I'm currently working on an app where users can select a name of a location and then see details of this location. I have 2 view states: "StartState" and "DetailState". On the "StartState" you only have one button to start the app. On the "DetailState" you have the list with the information of the location. What I'm trying to do is that after a while, the app returns to the StartState. It may sound silly, but once I know how to do it exactly, I can expand my application. So here is the most important piece of the code:

       

      private function viewStartState():void {

                                              currentState="StartState";

                                    }

       

                                    private function TimerDetail():void {

                                              if (currentState == "DetailState")

                                                        setTimeout(viewStartState, 100);

                                    }

       

      I have 2 functions: The function TimerDetail says that if the currentstate is "DetailState" it'll return to the viewStartState function in a certain amount of time. With this code, it isn't doing anything. What is wrong? Can somebody help me please?

       

      Thanx for everything :-).

       

      Bandai