4 Replies Latest reply on Aug 22, 2006 3:09 AM by Newsgroup_User

    sendAndLoad cancellation

    Jim_W Level 1
      Does anyone know of a simple way to cancel this process once the send has begun???
      I'd like to give my users the option to cancel without sending anymore data.

      Thanks for any help with this.

      Jim
        • 1. Re: sendAndLoad cancellation
          Level 7
          Set the object (LoadVars or XML) to undefined and use delete to remove it or
          send an abort message to the server with the same object.



          --
          Lon Hosford
          www.lonhosford.com
          Flash, Actionscript and Flash Media Server examples:
          http://flashexamples.hosfordusa.com
          May many happy bits flow your way!
          "gurthWERM" <webforumsuser@macromedia.com> wrote in message
          news:ec59bq$b6v$1@forums.macromedia.com...
          > Does anyone know of a simple way to cancel this process once the send has
          > begun???
          > I'd like to give my users the option to cancel without sending anymore
          > data.
          >
          > Thanks for any help with this.
          >
          > Jim
          >


          • 2. Re: sendAndLoad cancellation
            abeall Level 3
            I don't think that will actually cancel the process. It will nullified any affect it has on the SWF, but it will still continue to download it and spend bandwidth and processor power.

            In AS3.0, they finally added cancel methods to loading external data. Most data is loaded by a special loading class, URLLoader, and you can use the method close() to cancel loading.
            http://livedocs.macromedia.com/flex/2/langref/flash/net/URLLoader.html
            • 3. Re: sendAndLoad cancellation
              Jim_W Level 1
              Thanks for the replies guys.

              So, is it correct that there is no real way to achieve this in AS 2.0?
              Lon, have you tested your method and found that it actually works?

              Jim
              • 4. Re: sendAndLoad cancellation
                Level 7
                > Lon, have you tested your method and found that it actually works?
                I cannot provide validation that it would work from an intentional
                perspective. As I recall the loss of the Flash object results in the client
                side not longer handling server responses. As far as the server side
                completing the request or the client still processing the request, I do not
                know as I would not look to design client server internet application that
                way.

                What is not clear in the thread is the need versus the technical inquiry.
                Perhaps your need may be solvable with a different approach. For example, if
                the user cancels, that really sends a new network request that nullifies
                what was processed. Thus you need state on the server side to track the
                network transaction and the ability to undo.


                --
                Lon Hosford
                www.lonhosford.com
                Flash, Actionscript and Flash Media Server examples:
                http://flashexamples.hosfordusa.com
                May many happy bits flow your way!
                "gurthWERM" <webforumsuser@macromedia.com> wrote in message
                news:eccamf$9i9$1@forums.macromedia.com...
                > Thanks for the replies guys.
                >
                > So, is it correct that there is no real way to achieve this in AS 2.0?
                > Lon, have you tested your method and found that it actually works?
                >
                > Jim