4 Replies Latest reply on Jan 10, 2011 11:23 AM by jfb00

    Capture exit event

    jfb00 Level 3

      Hi All,

      How can I capture the exit event from a canvas component?

      I try exitState but it's not working:

       

      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
      backgroundColor="white" creationPolicy="all" exitState="checkExit()">
      
                  private function checkExit():void{
                      Alert.show("exit");
                  }
      

       

      I try the same removed but it doesn't start the form, it shows the Alert right away.

      removedFromState it doesn't work either.

      Any ideas?

      Thanks

       

      Johnny

        • 1. Re: Capture exit event
          Flex harUI Adobe Employee

          There might be additional properties on the event that can help you decide

          which state you are exiting and whether to do anything.

          • 2. Re: Capture exit event
            saisri2k2 Level 4

            remove

            removed

            removedFromStage

             

            They all work. Are you trying to remove the canvas from the display list? what are you trying to do here? if you are just hiding it by making visible = false, then try lookin for 'hide' event.

            • 3. Re: Capture exit event
              jfb00 Level 3

              Thanks for your reply and help.

              I have a menu with many options, each option will open a canvas component thru a viewStack.

              When I call the component I item with viewStack.selectedItem = mycomponenIDNumber and fire the init() funciton, now when I click something else in the menu if I'm in a component I want to check something before I leave the component and fire a condition like:

              Alert.show("Do you want to Save the updates?","ALERT", Alert.YES|Alert.NO, this, alertClickHandler);

               

              Remove, removed and removeFromState doesn't fire.

              Rgds

               

              Johnny

              • 4. Re: Capture exit event
                jfb00 Level 3

                Hide is working.

                Thanks!