1 Reply Latest reply on Aug 19, 2008 9:10 AM by Newsgroup_User

    detect/prevent when user is leaving the page

    mlmadque
      Is there any way from Flex to detect that the user is attempting to browse away from the web page the swf is loaded on and prevent it?

      I want to be able to warn the user that if they leave the page before they save they will lose changes.

      I am guessing no, but I am no guru so I thought I would put the question out here.

      Thanks.

      Marcus Mattingly
        • 1. Re: detect/prevent when user is leaving the page
          Level 7

          "mlmadque" <webforumsuser@macromedia.com> wrote in message
          news:g8ep2r$ith$1@forums.macromedia.com...
          > Is there any way from Flex to detect that the user is attempting to browse
          > away
          > from the web page the swf is loaded on and prevent it?
          >
          > I want to be able to warn the user that if they leave the page before they
          > save they will lose changes.
          >
          > I am guessing no, but I am no guru so I thought I would put the question
          > out
          > here.

          You can use JavaScript on the page to do this.

          HTH;

          Amy