3 Replies Latest reply on Mar 17, 2013 12:50 PM by Sean_Wilson

    LocalConnection communication to remote file

    Paul M Schwarz Level 1

      Hi,

       

      I'm trying to pass a message from Director to a Flash file via the LocalConnection object. Everything works fine when both files are local, but I get a status of 'Error' when the Flash file is remote.

       

      Is there any way to communicate with a linked Flash file (at a remote address) from a Director projector?

       

      Thanks,

      Paul

        • 1. Re: LocalConnection communication to remote file
          Sean_Wilson Adobe Community Professional

          Did you fiddle with the various options for allowDomain (Flash) and loadPolicyFile (Director)? See here and here for some more (hopefully useful) details.

           

          Here's something Allen Partridge posted to Direct-L back in 2010:

          Cross Domain Policy changes

           

          Earlier to Director 11.5, there was no Cross-domain checking based on the policy file and thus when we play any shockwave content which was accessing data from a server outside the domain, it used to throw-up security dialogs. In Director 11.5, we introduced the cross-domain checking based on policy files, placed on the servers. This meant that even the URLs accessed by the SWFs were being checked by the Shockwave player against the policy file. But flash player as such does cross-domain checking through policy files or through other security mechanisms (security.allowDomain). The checks which were done through the latter mechanism inside Flash player are not supported in Shockwave and because of this, the content which were accessed by this mechanism failed inside Shockwave.

           

          For example, we have a youTube video player asset, which is a SWF file and this can be used play different youtube videos by specifying the video ID. This has been implemented in Flash using the "security.allowDomain" mechanism for accessing the content from the YouTube server. This SWF can be hosted on any server (not only YouTube) and the videos can be streamed in.

           

          This movie when embedded inside the Shockwave player fails since the player checks only the policy file on the YouTube server. And this policy File on YouTube server does not list any of domains.

           

          In order to address this issue, we have introduced a flash cast member property cdpCheckMode which can be set to either #useMediaPolicy (to use the flash player's cross domain checks) or #useSWPolicy (to use Shockwave's cross domain checks).

           

          When we set the property to #useSWPolicy and if the policy file doesn't have the necessary entry then the content developer has two options.

           

          1. If the movie property enableSecurityDialog is set to true then security dialogs will appear in the Shockwave movie while trying to access the content and the option of displaying the content is given to the end user.

           

          2. On the other hand, if this flag is not set then the movie will fail silently.

           

          _movie.enableSecurityDialog

           

          Usage

           

          -- Lingo syntax

           

          _movie.enableSecurityDialog

           

          // JavaScript syntax

           

          _movie.enableSecurityDialog;

           

          Description

           

          Movie property; default value is FALSE, If it is false then the movie will fail silently. If it is set to TRUE then security dialogs will appear in the Shockwave movie while trying to access the content and the option of displaying the content is given to the end user.

           

          Example

           

          This statement sets the enableSecurityDialog property to True which will show the dialogs.

           

          -- Lingo syntax

           

          on prepareMovie

           

          _movie.enableSecurityDialog = TRUE

           

          end

           

          // JavaScript syntax

           

          function prepareMovie()

           

          {

           

          _movie.enableSecurityDialog = 1;

           

          }

           

          cdpCheckMode (Flash cast member property)

           

          Usage

           

          -- Lingo syntax

           

          member(whichFlashMember).cdpCheckMode

           

          // JavaScript syntax

           

          member(whichFlashMember).cdpCheckMode;

           

          Description

           

          Flash member property; default value is useSwPolicy. When we set the property to #useSWPolicy it will use Shockwave's cross domain checks and if the policy file doesn't have the necessary entry then the content developer has two options.

           

          1. If the movie property enableSecurityDialog is set to true then security dialogs will appear in the Shockwave movie while trying to access the content and the option of displaying the content is given to the end user.

           

          2. On the other hand, if this flag is not set then the movie will fail silently.

           

          When it is set to #useMediaPolicy it will use the flash player's cross domain checks.

           

          Example

           

          This statement sets the cdpCheckMode property to #useMediaPolicy which will follow the flash player's cross domain checks.

           

          -- Lingo syntax

           

          on beginSprite me

           

          member(2).cdpCheckMode = #useMediaPolicy

           

          end

           

          // JavaScript syntax

           

          function beginSprite(me)

           

          {

           

          member(2).cdpCheckMode = symbol("useMediaPolicy");

           

          }

          • 2. Re: LocalConnection communication to remote file
            Paul M Schwarz Level 1

            Thanks Sean. This was useful information, but unfortunately didn't help. It's a bug. HTTPS calls from a SWF don't work when the SWF is used within Director. It's been submitted to the Adobe team for a while, so hopefully it will be fixed in the next release.

             

            Paul

            • 3. Re: LocalConnection communication to remote file
              Sean_Wilson Adobe Community Professional

              ... hopefully it will be fixed in the next release.

              Don't hold your breath