1 Reply Latest reply on Jun 30, 2009 8:17 AM by Thomas B. Nielsen

    images in dialogs

    Seth McGraw Level 1

      Is there a way to have a panel contain a pic or swf in a dialog (CS4 or 3 javascript) ? I would like to make a dialog that has a small tutorial movie and/or logo pic in it.

        • 1. Re: images in dialogs
          Thomas B. Nielsen Level 3

          I think you need to use the scriptUI, in ESTK2 "Help" -> "Script UI classes"

           

          an example of loading a swf movie:

          (download files from http://www.nobrainer.dk/indesign-palette-window-with-flash/) just something i tested some time ago.

          #targetengine "session"
          // Globals

          var mySWF = File.openDialog("Select a .swf");´
          var w = new Window ("window { fp: FlashPlayer { preferredSize: [150,200] } }", "Flashplayer");
          w.margins = [10,10,10,10];

          w.fp.buttonClicked = function() {   
              alert ("We are done!");
          }

          w.onShow = function () {
              //var movieToPlay = new File ("Demo.swf");   
              try  {
                  w.fp.loadMovie (mySWF);
              }
              catch (e) {
                  alert ("Load Movie function failed: " + e);
              }
          }
          w.show();
          w.fp.invokePlayerFunction("setText", "Script Call" );


          A cut and paste of an icon button example:

          myButtonBar = new Window("palette", "TEXT", undefined, {maximizeButton:false, minimizeButton:false});
                  var image = ScriptUI.newImage(myParentFolder + "logo.png");
                  with(myButtonBar){
                      spacing = 0;
                      margins = [10,10,10,10];
                      alignment = "left";
                      with(add("group")) {
                         
                          with(add("panel", undefined)) {
                              margins = [5,5,5,5];
                              var myIconBtn= add('iconbutton', undefined, image);

                    ...

           

          Hope this helps