Loading ...
Sorry, an error occurred while loading the content.

RE: [flexcoders] Prevent users from running multiple instances at the same time.

Expand Messages
  • Alex Harui
    If you take out the catch and alert, do you get the error thrown? ________________________________ From: flexcoders@yahoogroups.com
    Message 1 of 9 , Nov 1, 2007
    View Source
    • 0 Attachment

      If you take out the catch and alert, do you get the error thrown?

       


      From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Malik Al-Arfaj
      Sent: Wednesday, October 31, 2007 6:06 PM
      To: flexcoders@yahoogroups.com
      Subject: Re: [flexcoders] Prevent users from running multiple instances at the same time.

       

      Alex, thanks for replying. May you please explain how can I do that?

      I tried:

      try
          {
              var myLC:LocalConnectio n;
              myLC = new LocalConnection( );
              myLC.connect("TestLC");
          }
          catch (err:ArgumentError)
          {
              Alert.show("Redirect to another page","Failure");   
          }

      but it doesn't seem to work..

      Regards,
      Malik

      On 10/31/07, Alex Harui <aharui@adobe. com> wrote:

      If the lc fails you can navigatetourl to a different page

       


      From: flexcoders@yahoogro ups.com [mailto: flexcoders@yahoogro ups.com] On Behalf Of m.arfaj
      Sent: Wednesday, October 31, 2007 1:24 PM
      To: flexcoders@yahoogro ups.com
      Subject: [flexcoders] Prevent users from running multiple instances at the same time.

       

      Hi,

      I embedded a flash 8 movie w/ AS2 in my flex application and used
      a local connection to exchange data. Everything works fine except that
      if
      I open the page twice, the Local connection in the second instance
      won't work -which screws the whole purpose of it-. The question is can
      I prevent the user from opening multiple instances from the same flash
      at the same time?! or at least if it is not possible in Flex, is there
      another way to do it with JavaScript or PHP?!

      Regards,
      Malik

       

    • Malik Al-Arfaj
      No, everything works fine except that the flex won t interact with the flash movie in the second instance.
      Message 2 of 9 , Nov 1, 2007
      View Source
      • 0 Attachment
        No, everything works fine except that the flex won't interact with the
        flash movie in the second instance.

        On Nov 1, 2007 11:12 AM, Alex Harui <aharui@...> wrote:
        >
        >
        >
        >
        >
        >
        >
        >
        >
        > If you take out the catch and alert, do you get the error thrown?
        >
        >
        >
        > ________________________________
        >
        >
        > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
        > Behalf Of Malik Al-Arfaj
        > Sent: Wednesday, October 31, 2007 6:06 PM
        > To: flexcoders@yahoogroups.com
        > Subject: Re: [flexcoders] Prevent users from running multiple instances at
        > the same time.
        >
        >
        >
        >
        >
        >
        >
        >
        > Alex, thanks for replying. May you please explain how can I do that?
        >
        > I tried:
        >
        > try
        > {
        > var myLC:LocalConnection;
        > myLC = new LocalConnection();
        > myLC.connect("TestLC");
        > }
        > catch (err:ArgumentError)
        > {
        > Alert.show("Redirect to another page","Failure");
        > }
        >
        > but it doesn't seem to work..
        >
        > Regards,
        > Malik
        >
        >
        > On 10/31/07, Alex Harui <aharui@...> wrote:
        >
        >
        >
        >
        >
        >
        > If the lc fails you can navigatetourl to a different page
        >
        >
        >
        > ________________________________
        >
        >
        > From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On
        > Behalf Of m.arfaj
        > Sent: Wednesday, October 31, 2007 1:24 PM
        > To: flexcoders@yahoogroups.com
        > Subject: [flexcoders] Prevent users from running multiple instances at the
        > same time.
        >
        >
        >
        >
        >
        >
        > Hi,
        >
        > I embedded a flash 8 movie w/ AS2 in my flex application and used
        > a local connection to exchange data. Everything works fine except that
        > if
        > I open the page twice, the Local connection in the second instance
        > won't work -which screws the whole purpose of it-. The question is can
        > I prevent the user from opening multiple instances from the same flash
        > at the same time?! or at least if it is not possible in Flex, is there
        > another way to do it with JavaScript or PHP?!
        >
        > Regards,
        > Malik
        >
        >
        >
        >
        >
        >
      • Alex Harui
        If you aren t getting a failure on connect, do you get one on send? ________________________________ From: flexcoders@yahoogroups.com
        Message 3 of 9 , Nov 1, 2007
        View Source
        • 0 Attachment

          If you aren’t getting a failure on connect, do you get one on send?

           


          From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Malik Al-Arfaj
          Sent: Thursday, November 01, 2007 11:25 AM
          To: flexcoders@yahoogroups.com
          Subject: Re: [flexcoders] Prevent users from running multiple instances at the same time.

           

          No, everything works fine except that the flex won't interact with the
          flash movie in the second instance.

          On Nov 1, 2007 11:12 AM, Alex Harui <aharui@adobe. com> wrote:

          >
          >
          >
          >
          >
          >
          >
          >
          >
          > If you take out the catch and alert, do you get the error thrown?
          >
          >
          >
          > ____________ _________ _________ __
          >
          >
          > From: flexcoders@yahoogro ups.com
          [mailto:flexcoders@yahoogro ups.com] On
          > Behalf Of Malik Al-Arfaj
          > Sent: Wednesday, October 31, 2007 6:06 PM
          > To: flexcoders@yahoogro ups.com
          > Subject: Re: [flexcoders] Prevent users from running multiple instances at
          > the same time.
          >
          >
          >
          >
          >
          >
          >
          >
          > Alex, thanks for replying. May you please explain how can I do that?
          >
          > I tried:
          >
          > try
          > {
          > var myLC:LocalConnectio n;
          > myLC = new LocalConnection( );
          > myLC.connect( "TestLC") ;
          > }
          > catch (err:ArgumentError)
          > {
          > Alert.show(" Redirect to another page","Failure" );
          > }
          >
          > but it doesn't seem to work..
          >
          > Regards,
          > Malik
          >
          >
          > On 10/31/07, Alex Harui <aharui@adobe. com>
          wrote:
          >
          >
          >
          >
          >
          >
          > If the lc fails you can navigatetourl to a different page
          >
          >
          >
          > ____________ _________ _________ __
          >
          >
          > From: flexcoders@yahoogro ups.com
          [mailto: flexcoders@yahoogro ups.com] On
          > Behalf Of m.arfaj
          > Sent: Wednesday, October 31, 2007 1:24 PM
          > To: flexcoders@yahoogro ups.com
          > Subject: [flexcoders] Prevent users from running multiple instances at the
          > same time.
          >
          >
          >
          >
          >
          >
          > Hi,
          >
          > I embedded a flash 8 movie w/ AS2 in my flex application and used
          > a local connection to exchange data. Everything works fine except that
          > if
          > I open the page twice, the Local connection in the second instance
          > won't work -which screws the whole purpose of it-. The question is can
          > I prevent the user from opening multiple instances from the same flash
          > at the same time?! or at least if it is not possible in Flex, is there
          > another way to do it with JavaScript or PHP?!
          >
          > Regards,
          > Malik
          >
          >
          >
          >
          >
          >

        • Malik Al-Arfaj
          No, it doesn t throw any kind of error! What happens is that the flash will run by it s default values and will not be affected by the values that should
          Message 4 of 9 , Nov 1, 2007
          View Source
          • 0 Attachment
            No, it doesn't throw any kind of error! What happens is that the flash
            will run by it's default values and will not be affected by the values
            that 'should' have been passed to it. Well, thanks to that, I thought
            of creating a dummy flash that runs at the beginning of the flex
            application. And it will wait for flex to contact it. After being
            contacted by flex it will send a variable to the parent flex
            application through another local connection to tell flex that
            everything is fine and it is OK to proceed. I will try that and report
            the results later tonight.

            Regards,
            Malik

            On Nov 1, 2007 1:32 PM, Alex Harui <aharui@...> wrote:
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > If you aren't getting a failure on connect, do you get one on send?
            >
            >
            >
            > ________________________________
            >
            >
            > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
            > Behalf Of Malik Al-Arfaj
            > Sent: Thursday, November 01, 2007 11:25 AM
            >
            >
            > To: flexcoders@yahoogroups.com
            > Subject: Re: [flexcoders] Prevent users from running multiple instances at
            > the same time.
            >
            >
            >
            >
            >
            >
            >
            >
            > No, everything works fine except that the flex won't interact with the
            > flash movie in the second instance.
            >
            > On Nov 1, 2007 11:12 AM, Alex Harui <aharui@...> wrote:
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > > If you take out the catch and alert, do you get the error thrown?
            > >
            > >
            > >
            > > ________________________________
            > >
            > >
            > > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
            > > Behalf Of Malik Al-Arfaj
            > > Sent: Wednesday, October 31, 2007 6:06 PM
            > > To: flexcoders@yahoogroups.com
            > > Subject: Re: [flexcoders] Prevent users from running multiple instances
            > at
            > > the same time.
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > > Alex, thanks for replying. May you please explain how can I do that?
            > >
            > > I tried:
            > >
            > > try
            > > {
            > > var myLC:LocalConnection;
            > > myLC = new LocalConnection();
            > > myLC.connect("TestLC");
            > > }
            > > catch (err:ArgumentError)
            > > {
            > > Alert.show("Redirect to another page","Failure");
            > > }
            > >
            > > but it doesn't seem to work..
            > >
            > > Regards,
            > > Malik
            > >
            > >
            > > On 10/31/07, Alex Harui <aharui@...> wrote:
            > >
            > >
            > >
            > >
            > >
            > >
            > > If the lc fails you can navigatetourl to a different page
            > >
            > >
            > >
            > > ________________________________
            > >
            > >
            > > From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On
            > > Behalf Of m.arfaj
            > > Sent: Wednesday, October 31, 2007 1:24 PM
            > > To: flexcoders@yahoogroups.com
            > > Subject: [flexcoders] Prevent users from running multiple instances at
            > the
            > > same time.
            > >
            > >
            > >
            > >
            > >
            > >
            > > Hi,
            > >
            > > I embedded a flash 8 movie w/ AS2 in my flex application and used
            > > a local connection to exchange data. Everything works fine except that
            > > if
            > > I open the page twice, the Local connection in the second instance
            > > won't work -which screws the whole purpose of it-. The question is can
            > > I prevent the user from opening multiple instances from the same flash
            > > at the same time?! or at least if it is not possible in Flex, is there
            > > another way to do it with JavaScript or PHP?!
            > >
            > > Regards,
            > > Malik
            > >
            > >
            > >
            > >
            > >
            > >
            >
            >
            >
            >
          • Malik AlArfaj
            Issue solved.. I notice that if I make the local connection from flex to flash (not the other way around as I tried before), it will throw an error if it is
            Message 5 of 9 , Nov 1, 2007
            View Source
            • 0 Attachment
              Issue solved..

              I notice that if I make the local connection from flex to flash (not
              the other way around as I tried before), it will throw an error if it
              is already connectd.

              So, to summarize:
              If you want to prevent the user from running multiple instances .. you
              create a new local connection and make it connect as follows:
              private function initil():void
              {
              try{
              dReceiveLC = new LocalConnection();
              dReceiveLC.client = this;
              dReceiveLC.connect("dummyFlash2Flex");
              } catch(err:ArgumentError)
              {
              Alert.show(err.message,err.errorID.toString());
              }
              }
              It will catch an error if it is already connected.

              Alex, thank you for helping me through this problem. Your help is
              highly appreciated.

              Regards, Malik



              On Nov 1, 2007 8:27 PM, Malik Al-Arfaj <alarfaj@...> wrote:
              > No, it doesn't throw any kind of error! What happens is that the flash
              > will run by it's default values and will not be affected by the values
              > that 'should' have been passed to it. Well, thanks to that, I thought
              > of creating a dummy flash that runs at the beginning of the flex
              > application. And it will wait for flex to contact it. After being
              > contacted by flex it will send a variable to the parent flex
              > application through another local connection to tell flex that
              > everything is fine and it is OK to proceed. I will try that and report
              > the results later tonight.
              >
              > Regards,
              > Malik
              >
              >
              > On Nov 1, 2007 1:32 PM, Alex Harui <aharui@...> wrote:
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > > If you aren't getting a failure on connect, do you get one on send?
              > >
              > >
              > >
              > > ________________________________
              > >
              > >
              > > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
              > > Behalf Of Malik Al-Arfaj
              > > Sent: Thursday, November 01, 2007 11:25 AM
              > >
              > >
              > > To: flexcoders@yahoogroups.com
              > > Subject: Re: [flexcoders] Prevent users from running multiple instances at
              > > the same time.
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > > No, everything works fine except that the flex won't interact with the
              > > flash movie in the second instance.
              > >
              > > On Nov 1, 2007 11:12 AM, Alex Harui <aharui@...> wrote:
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > > If you take out the catch and alert, do you get the error thrown?
              > > >
              > > >
              > > >
              > > > ________________________________
              > > >
              > > >
              > > > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
              > > > Behalf Of Malik Al-Arfaj
              > > > Sent: Wednesday, October 31, 2007 6:06 PM
              > > > To: flexcoders@yahoogroups.com
              > > > Subject: Re: [flexcoders] Prevent users from running multiple instances
              > > at
              > > > the same time.
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > > Alex, thanks for replying. May you please explain how can I do that?
              > > >
              > > > I tried:
              > > >
              > > > try
              > > > {
              > > > var myLC:LocalConnection;
              > > > myLC = new LocalConnection();
              > > > myLC.connect("TestLC");
              > > > }
              > > > catch (err:ArgumentError)
              > > > {
              > > > Alert.show("Redirect to another page","Failure");
              > > > }
              > > >
              > > > but it doesn't seem to work..
              > > >
              > > > Regards,
              > > > Malik
              > > >
              > > >
              > > > On 10/31/07, Alex Harui <aharui@...> wrote:
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > > If the lc fails you can navigatetourl to a different page
              > > >
              > > >
              > > >
              > > > ________________________________
              > > >
              > > >
              > > > From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On
              > > > Behalf Of m.arfaj
              > > > Sent: Wednesday, October 31, 2007 1:24 PM
              > > > To: flexcoders@yahoogroups.com
              > > > Subject: [flexcoders] Prevent users from running multiple instances at
              > > the
              > > > same time.
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > > Hi,
              > > >
              > > > I embedded a flash 8 movie w/ AS2 in my flex application and used
              > > > a local connection to exchange data. Everything works fine except that
              > > > if
              > > > I open the page twice, the Local connection in the second instance
              > > > won't work -which screws the whole purpose of it-. The question is can
              > > > I prevent the user from opening multiple instances from the same flash
              > > > at the same time?! or at least if it is not possible in Flex, is there
              > > > another way to do it with JavaScript or PHP?!
              > > >
              > > > Regards,
              > > > Malik
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > >
              > >
              > >
              > >
              >
            • Malik AlArfaj
              Just an addition, I was wondering why the first code didn t work. I noticed that I defined the local connection inside a function, which I believe means that
              Message 6 of 9 , Nov 1, 2007
              View Source
              • 0 Attachment
                Just an addition, I was wondering why the first code didn't work. I
                noticed that I defined the local connection inside a function, which I
                believe means that it would be removed as soon as the function is
                executed. That's why it didn't throw an error, in the second code, I
                defined the LC outside the function and it worked.

                Regards,
                Malik

                On Nov 1, 2007 9:20 PM, Malik AlArfaj <alarfaj@...> wrote:
                > Issue solved..
                >
                > I notice that if I make the local connection from flex to flash (not
                > the other way around as I tried before), it will throw an error if it
                > is already connectd.
                >
                > So, to summarize:
                > If you want to prevent the user from running multiple instances .. you
                > create a new local connection and make it connect as follows:
                > private function initil():void
                > {
                > try{
                > dReceiveLC = new LocalConnection();
                > dReceiveLC.client = this;
                > dReceiveLC.connect("dummyFlash2Flex");
                > } catch(err:ArgumentError)
                > {
                > Alert.show(err.message,err.errorID.toString());
                > }
                > }
                > It will catch an error if it is already connected.
                >
                > Alex, thank you for helping me through this problem. Your help is
                > highly appreciated.
                >
                > Regards, Malik
                >
                >
                >
                >
                > On Nov 1, 2007 8:27 PM, Malik Al-Arfaj <alarfaj@...> wrote:
                > > No, it doesn't throw any kind of error! What happens is that the flash
                > > will run by it's default values and will not be affected by the values
                > > that 'should' have been passed to it. Well, thanks to that, I thought
                > > of creating a dummy flash that runs at the beginning of the flex
                > > application. And it will wait for flex to contact it. After being
                > > contacted by flex it will send a variable to the parent flex
                > > application through another local connection to tell flex that
                > > everything is fine and it is OK to proceed. I will try that and report
                > > the results later tonight.
                > >
                > > Regards,
                > > Malik
                > >
                > >
                > > On Nov 1, 2007 1:32 PM, Alex Harui <aharui@...> wrote:
                > > >
                > > >
                > > >
                > > >
                > > >
                > > >
                > > >
                > > >
                > > >
                > > > If you aren't getting a failure on connect, do you get one on send?
                > > >
                > > >
                > > >
                > > > ________________________________
                > > >
                > > >
                > > > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
                > > > Behalf Of Malik Al-Arfaj
                > > > Sent: Thursday, November 01, 2007 11:25 AM
                > > >
                > > >
                > > > To: flexcoders@yahoogroups.com
                > > > Subject: Re: [flexcoders] Prevent users from running multiple instances at
                > > > the same time.
                > > >
                > > >
                > > >
                > > >
                > > >
                > > >
                > > >
                > > >
                > > > No, everything works fine except that the flex won't interact with the
                > > > flash movie in the second instance.
                > > >
                > > > On Nov 1, 2007 11:12 AM, Alex Harui <aharui@...> wrote:
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > > If you take out the catch and alert, do you get the error thrown?
                > > > >
                > > > >
                > > > >
                > > > > ________________________________
                > > > >
                > > > >
                > > > > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
                > > > > Behalf Of Malik Al-Arfaj
                > > > > Sent: Wednesday, October 31, 2007 6:06 PM
                > > > > To: flexcoders@yahoogroups.com
                > > > > Subject: Re: [flexcoders] Prevent users from running multiple instances
                > > > at
                > > > > the same time.
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > > Alex, thanks for replying. May you please explain how can I do that?
                > > > >
                > > > > I tried:
                > > > >
                > > > > try
                > > > > {
                > > > > var myLC:LocalConnection;
                > > > > myLC = new LocalConnection();
                > > > > myLC.connect("TestLC");
                > > > > }
                > > > > catch (err:ArgumentError)
                > > > > {
                > > > > Alert.show("Redirect to another page","Failure");
                > > > > }
                > > > >
                > > > > but it doesn't seem to work..
                > > > >
                > > > > Regards,
                > > > > Malik
                > > > >
                > > > >
                > > > > On 10/31/07, Alex Harui <aharui@...> wrote:
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > > If the lc fails you can navigatetourl to a different page
                > > > >
                > > > >
                > > > >
                > > > > ________________________________
                > > > >
                > > > >
                > > > > From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On
                > > > > Behalf Of m.arfaj
                > > > > Sent: Wednesday, October 31, 2007 1:24 PM
                > > > > To: flexcoders@yahoogroups.com
                > > > > Subject: [flexcoders] Prevent users from running multiple instances at
                > > > the
                > > > > same time.
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > > Hi,
                > > > >
                > > > > I embedded a flash 8 movie w/ AS2 in my flex application and used
                > > > > a local connection to exchange data. Everything works fine except that
                > > > > if
                > > > > I open the page twice, the Local connection in the second instance
                > > > > won't work -which screws the whole purpose of it-. The question is can
                > > > > I prevent the user from opening multiple instances from the same flash
                > > > > at the same time?! or at least if it is not possible in Flex, is there
                > > > > another way to do it with JavaScript or PHP?!
                > > > >
                > > > > Regards,
                > > > > Malik
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > >
                > > >
                > > >
                > > >
                > >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.