2 Replies Latest reply on Jun 21, 2012 12:35 AM by VanithaAllwin

    Export selection of objects as swf

    VanithaAllwin Level 1

      Hi,

       

      I have a requirement to export selection of objects at runtime as swf. The size of swf should be the height and width of object selected. Please somebody help. I need this code urgently.

       

      Regards,

      Vanitha Allwin

        • 1. Re: Export selection of objects as swf
          csm_phil Level 4

          Hello,

           

          Can you post your js code, what have been tried from in this regards. If you post your js code you have face the problem so any one will help to you easy, otherwise its difficult.

           

          thx

          csm_phil

          • 2. Re: Export selection of objects as swf
            VanithaAllwin Level 1

            #target indesign

            var saveFolder; 

            main();

              function main(){   

                 saveFolder = Folder( Folder.desktop + '/SWFs' );

                    if ( ! saveFolder.exists )

                    {

                        saveFolder.create();

                        }

                app.swfExportPreferences.fitScale = 100;

                app.swfExportPreferences.dynamicDocumentExportReaderSpreads = 0;

                app.swfExportPreferences.rasterizePages = false;

                app.swfExportPreferences.generateHTML = false;

                app.swfExportPreferences.viewSWFAfterExporting = false;

                app.swfExportPreferences.textExportPolicy = DynamicDocumentsTextExportPolicy.live;

                app.swfExportPreferences.rasterCompression = RasterCompressionOptions.losslessCompression;

                app.swfExportPreferences.jpegQualityOptions = DynamicDocumentsJPEGQualityOptions.maximum;

                app.swfExportPreferences.curveQuality = SWFCurveQualityValue.maximum;

                app.swfExportPreferences.rasterResolution = 100;

             

                 for (var j=0; j<app.documents.length;j++){

                    SelectGroups (app.documents[j]);

                }

            }

            function SelectGroups(doc) {

                  var i, grps, expFile;

                 for(var cnt=0;cnt<doc.pages.length;cnt++)

                 {

                    grps = doc.pages[cnt].groups;

                    app.activeDocument=doc;

                    app.activeWindow.activePage=doc.pages[cnt];    

                    for ( i = 0; i < grps.length; i++ ) {

                        expFile = File( saveFolder + '/page' + '_' + ( i + 1 ) + '.swf' );

                        app.select(NothingEnum.NOTHING);

                        doc.pages[cnt].groups[i].select();

                        var exporting=app.selection[0];

                        exporting.exportFile( ExportFormat.SWF, expFile, false );

                    };

                   

                }

            };

             

            This is the script i have used. The whole page is exported as swf instead of only the selection. Please help.