8 Replies Latest reply on Feb 10, 2012 11:24 AM by Alibented

    do Xtras of Buddy API work in .dcr files ?

    Alibented

      I’m having a problem using one of Buddy API 4.07 Xtras in a .dcr file.

      In the Lingo Help file of Director MX and 11  is stated: “If the Shockwave movie you’re creating will be distributed on the Internet and requires any Xtra extensions, make sure the Xtra extensions are listed in the Movie Xtras dialog box and that Download If Needed is selected for each required Xtra extension”.

      Buddy API Xtra.x32 is listed in the Movie Xtras dialog box of my movie.

      The Xtra works perfectly inside my .dir movie, but when I convert this movie to a .dcr and .htm file the Xtra I’m using does not work in this .dcr file.

      Can anyone help me solve this problem ?

      Ted

        • 1. Re: do Xtras of Buddy API work in .dcr files ?
          Sean_Wilson Adobe Community Professional

          This xtra isn't Shockwave-safe so can't be used in a file published to Shockwave and viewed in a browser.

          • 2. Re: do Xtras of Buddy API work in .dcr files ?
            Alibented Level 1

            Hi Sean,

             

            Thank you for your clear answer.

            Looking at the Buddy API site, I see Adobe encourage users to register and pay for these Xtras, but no restrictions for its use are mentioned.

            I even bought Director 11 expecting these Xtras to be incorporated in the application’s Xtras folder.

            No such luck.

            As a matter of fact I hardly see any difference with Director MX, issued well over a decade earlier !

            I was trying to make use of the baLanguage() function, but now have to go back to having the text displayed in different languages instigated manually by the user.

             

            Using (the environment)[#osLanguage], as suggested by you before, only returns “English” or “Other”, so this is not the way to go for me.

             

            Ted

             

             

             

             

             

            Van: Sean_Wilson forums@adobe.com

            Verzonden: vrijdag 3 februari 2012 1:43

            Aan: Alibented

            Onderwerp: do Xtras of Buddy API work in .dcr files ?

             

             

             

             

             

            Re: do Xtras of Buddy API work in .dcr files ?

             

             

            created by Sean_Wilson <http://forums.adobe.com/people/Sean_Wilson>  in Director Lingo - View the full discussion <http://forums.adobe.com/message/4182631#4182631

            • 3. Re: do Xtras of Buddy API work in .dcr files ?
              Dee McDee Level 2

              You could call a function inside an AS3 Flash sprite to return the system language (in ISO 639-1 language code). I just tried using the flash.system.Capabilities package inside Director and it worked fine.

               

              The only problem is that AS3 is supported only in Director 11.5 with the Hotfixes.

              • 4. Re: do Xtras of Buddy API work in .dcr files ?
                Alibented Level 1

                Hi Dee,

                 

                I’m unfamiliar with AS3 Flash sprites inside Director and using ISO 639-1 language code.

                 

                I have used Director MX a long time and just spent my money on Director 11.

                If only Director 11.5 can take care, I guess that’s the end of the line for me.

                Thanks for your help,

                 

                Ted

                 

                 

                 

                Van: Dee McDee forums@adobe.com

                Verzonden: zondag 5 februari 2012 2:18

                Aan: Alibented

                Onderwerp: do Xtras of Buddy API work in .dcr files ?

                 

                 

                 

                 

                 

                Re: do Xtras of Buddy API work in .dcr files ?

                 

                 

                created by Dee McDee <http://forums.adobe.com/people/Dee+McDee>  in Director Lingo - View the full discussion <http://forums.adobe.com/message/4186460#4186460

                • 5. Re: do Xtras of Buddy API work in .dcr files ?
                  Dee McDee Level 2

                  There is another possibility that does not involve BuddyAPI or Flash: you could get the system language using php:

                  http://fundisom.com/phparadise/php/information/detect_user_language

                   

                  Using a php scriptlet, the language code could be written into an external parameter in your HTML:

                  sw9='<?php echo lixlpixel_detect_lang(); ?>'

                   

                  When the Shockwave movie loads, the user's language could then be retrieved from the external parameter:

                   

                  global gLanguage

                   

                  on startMovie

                    gLanguage = _player.externalParamName("sw9")

                  end startMovie

                  • 6. Re: do Xtras of Buddy API work in .dcr files ?
                    Alibented Level 1

                    Hi Dee,

                     

                    Wow, just when I was about to give in and accept I would never succeed in having Director 11 to check the language used by the user, you come up with another possibility.

                    I don’t fully understand the way it should work, but I’m trying.

                     

                    I have created a .php script similar to the link you directed me to.

                    Just used the 5 languages I need and left out all others languages.

                    I understand this .php script should be placed next to the other files in my website.

                    There is already another .php script there that organises the user’s computer to open my website in the same language as his operating system.

                    I don’t think these scripts will interfere with each other.

                     

                    What I don’t understand is where I should place the text:

                    sw9='<?php echo lixlpixel_detect_lang(); ?>

                    I am assuming this part will be used by Director to return a number or string that I can use to use the language I want to show.

                     

                    However, when using the lines:

                    global gLanguage

                    on startMovie

                      gLanguage = _player.externalParamName("sw9")

                    end startMovie

                    the following script error is given: gLanguage = _player.?externalParamName("sw9")

                    I don’t understand as gLanguage is declared to be a global variable.

                     

                    Furthermore I don’t understand what will happen so I can use different languages.

                    Appreciate your help,

                     

                    Ted

                     

                     

                     

                     

                     

                    Van: Dee McDee forums@adobe.com

                    Verzonden: zondag 5 februari 2012 18:24

                    Aan: Alibented

                    Onderwerp: do Xtras of Buddy API work in .dcr files ?

                     

                     

                     

                     

                     

                    Re: do Xtras of Buddy API work in .dcr files ?

                     

                     

                    created by Dee McDee <http://forums.adobe.com/people/Dee+McDee>  in Director Lingo - View the full discussion <http://forums.adobe.com/message/4187119#4187119

                    • 7. Re: do Xtras of Buddy API work in .dcr files ?
                      Dee McDee Level 2

                      I would probably have opted for the Flash solution, because I dislike involving the server unless totally necessary.

                       

                      But, as it's not an option for you, I have set up a simple demonstration of the PHP technique that I suggested:

                      http://gamebazaar.comxa.com/lang_test/test.php

                       

                      This is the PHP script used:

                       

                      <?php

                       

                      function lixlpixel_get_env_var($Var)

                      {

                      if(empty($GLOBALS[$Var]))

                      {

                        $GLOBALS[$Var]=(!empty($GLOBALS['_SERVER'][$Var]))?

                        $GLOBALS['_SERVER'][$Var]:

                        (!empty($GLOBALS['HTTP_SERVER_VARS'][$Var]))?

                        $GLOBALS['HTTP_SERVER_VARS'][$Var]:'';

                      }

                      }

                       

                      function lixlpixel_detect_lang()

                      {

                      // Detect HTTP_ACCEPT_LANGUAGE & HTTP_USER_AGENT.

                      lixlpixel_get_env_var('HTTP_ACCEPT_LANGUAGE');

                      lixlpixel_get_env_var('HTTP_USER_AGENT');

                       

                      $_AL=strtolower($GLOBALS['HTTP_ACCEPT_LANGUAGE']);

                      $_UA=strtolower($GLOBALS['HTTP_USER_AGENT']);

                       

                      // Try to detect Primary language if several languages are accepted.

                      foreach($GLOBALS['_LANG'] as $K)

                      {

                        if(strpos($_AL, $K)===0)

                         return $K;

                      }

                       

                      // Try to detect any language if not yet detected.

                      foreach($GLOBALS['_LANG'] as $K)

                      {

                        if(strpos($_AL, $K)!==false)

                         return $K;

                      }

                      foreach($GLOBALS['_LANG'] as $K)

                      {

                        if(preg_match("/[\[\( ]{$K}[;,_\-\)]/",$_UA))

                         return $K;

                      }

                       

                      // Return default language if language is not yet detected.

                      return $GLOBALS['_DLANG'];

                      }

                       

                      // Define default language.

                      $GLOBALS['_DLANG']='en';

                       

                      // Define all available languages.

                      // WARNING: uncomment all available languages

                       

                      $GLOBALS['_LANG'] = array(

                      'af', // afrikaans.

                      'ar', // arabic.

                      'bg', // bulgarian.

                      'ca', // catalan.

                      'cs', // czech.

                      'da', // danish.

                      'de', // german.

                      'el', // greek.

                      'en', // english.

                      'es', // spanish.

                      'et', // estonian.

                      'fi', // finnish.

                      'fr', // french.

                      'gl', // galician.

                      'he', // hebrew.

                      'hi', // hindi.

                      'hr', // croatian.

                      'hu', // hungarian.

                      'id', // indonesian.

                      'it', // italian.

                      'ja', // japanese.

                      'ko', // korean.

                      'ka', // georgian.

                      'lt', // lithuanian.

                      'lv', // latvian.

                      'ms', // malay.

                      'nl', // dutch.

                      'no', // norwegian.

                      'pl', // polish.

                      'pt', // portuguese.

                      'ro', // romanian.

                      'ru', // russian.

                      'sk', // slovak.

                      'sl', // slovenian.

                      'sq', // albanian.

                      'sr', // serbian.

                      'sv', // swedish.

                      'th', // thai.

                      'tr', // turkish.

                      'uk', // ukrainian.

                      'zh' // chinese.

                      );

                       

                      ?>

                       

                      <html>

                      <head>

                      <title>PHP Language Detection Test Page</title>

                      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

                      </head>

                      <body bgColor="#99CCCC">

                      <object classid="clsid:233C1507-6A77-46A4-9443-F871F945D258" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=11,5,9,629" ID=lang width=320 height=240>

                      <param name=src value="lang.dcr">

                      <param name=swRemote value="swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true' ">

                      <param name=swStretchStyle value=none>

                      <param name=sw9 value="<?php echo lixlpixel_detect_lang(); ?>">

                      <param name=PlayerVersion value=11>

                      <PARAM NAME=bgColor VALUE=#99CCCC>

                      <embed src="lang.dcr" bgColor=#99CCCC  width=320 height=240 swRemote="swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true' " swStretchStyle=none sw9='<?php echo lixlpixel_detect_lang(); ?>' type="application/x-director" PlayerVersion=11 pluginspage="http://www.macromedia.com/shockwave/download/"></embed>

                      </object>

                      </body>

                      </html>

                       

                      I have highlighted the two php scriptlets in red. The first is for MS Internet Explorer, the second for Firefox and Opera, etc.

                       

                      The button script in the Shockwave movie is incredibly simple (in my second post I used externalParamName when it ought to have been externalParamValue; we all make mistakes):

                       

                      on mouseUp me

                        tLangCode = _player.externalParamValue("sw9")

                        _player.alert("The language detected through PHP is"&&tLangCode)

                      end mouseUp

                      • 8. Re: do Xtras of Buddy API work in .dcr files ?
                        Alibented Level 1

                        Dee,

                        I have completely lost you.

                        I think there is some miscommunication.

                        Can I ask you to contact me directly at boscoclocks@zonnet.nl to sort things out ?

                        Ted

                         

                         

                         

                        Van: Dee McDee forums@adobe.com

                        Verzonden: vrijdag 10 februari 2012 0:44

                        Aan: Alibented

                        Onderwerp: do Xtras of Buddy API work in .dcr files ?

                         

                         

                         

                         

                         

                        Re: do Xtras of Buddy API work in .dcr files ?

                         

                         

                        created by Dee McDee <http://forums.adobe.com/people/Dee+McDee>  in Director Lingo - View the full discussion <http://forums.adobe.com/message/4197258#4197258