3 Replies Latest reply on Jul 29, 2014 3:11 AM by Nipun Asthana

    Flash pro cc xul controlls jsfl need help

    Svolash

      Hello all

       

      i had used flash cs for a while and was using lots of downloaded jsfl commands that would help me speed up work

       

      Switched to cc lately and those commands do not work

       

      heres a code of one of not working commands.

       

      dialog buttons="accept, cancel" title="Search and Replace v1.0">

      <grid>

      <columns>

          <column />

          <column />

      </columns>

      <rows>

          <row>

         

          <label control="searchFor" value="Search For:" />

              <textbox id="searchFor" value="" />

          </row>

          <row>

          <label control="replaceWith" value="Replace With:" />

              <textbox id="replaceWith" value="" />

          </row>

         

          <spacer />

              <radiogroup id="searchType"/>

                  <radio label="Search All Items" selected = "true" />

                  <radio label="Search Selected Items" />

              </radiogroup>

      </grid>

      </dialog>

       

       

       

      Could you tell me what to modify so i can run this command under CC

       

      Thanks in advance

        • 1. Re: Flash pro cc xul controlls jsfl need help
          Svolash Level 1

          sorry that was only the xml window code for the command

          the real code for the command is this:

           

          var doc = fl.getDocumentDOM();

          var lib = doc.library;

          var allItems = lib.items;

          var selItems = lib.getSelectedItems();

          var searchItems;

          var nameList

          var oldname;

          var newname;

          var xml = doc.xmlPanel(fl.configURI + "XULControls/SearchReplace.xml");

          if(xml.dismiss == 'accept'){

              var searchFor = xml.searchFor;

              var replaceWith = xml.replaceWith;

              if(xml.searchType == "Search Selected Items"){

                  searchItems = selItems;

                  nameList = removePath(true);

              }else{

                  searchItems = allItems;

                  nameList = removePath(false);

              }

              if(searchItems.length == 0){

                  alert("No Library items selected");

              }else{

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

                      oldname = nameList[i];

                      newname = oldname.replace(searchFor, replaceWith);

                      searchItems[i].name = newname;

                  }

              }

          }

             

           

          function removePath(bSelItems){

              if(bSelItems){

                  libSelPath=fl.getDocumentDOM().library.getSelectedItems();

              }else{

                  libSelPath=fl.getDocumentDOM().library.items;

              }

              itemNames = new Array();

              for (a = 0; a < libSelPath.length; a++){

                  charStart = libSelPath[a].name.lastIndexOf("/") + 1;

                  itemNames[a] = libSelPath[a].name.substring(charStart);

              }

              return itemNames;

          }

           

          thx

          • 2. Re: Flash pro cc xul controlls jsfl need help
            Svolash Level 1

            after some digging in the code i realized that the error here is in the xml file that the command is pointing at.

             

            actually the error is in the way columns are represented, after i deleted the columns lines the tool came back to life, warped but not too bad

             

            Does anybody here know how to recode the columns property?

            • 3. Re: Flash pro cc xul controlls jsfl need help
              Nipun Asthana Adobe Employee

              The arrangement seems to be a little incorrect.

              </rows> is missing and </grid> looks to be misplaced.

               

              You should put both these closing tags just after the last </row> tag (above the <spacer /> tag).

              ------------------------------------------------------------------------------------------ ----------

              <dialog buttons="accept, cancel" title="Search and Replace v1.0">

              <grid>

              <columns>

                  <column />

                  <column />

              </columns>

              <rows>

                  <row>  

                       <label control="searchFor" value="Search For:" />

                       <textbox id="searchFor" value="" />

                  </row>

                  <row>

                       <label control="replaceWith" value="Replace With:" />

                       <textbox id="replaceWith" value="" />

                  </row>

              </rows>

              </grid>

                  <spacer />

                      <radiogroup id="searchType"/>

                          <radio label="Search All Items" selected = "true" />

                          <radio label="Search Selected Items" />

                      </radiogroup>

              </dialog>