2 Replies Latest reply on Mar 5, 2012 9:13 AM by birnerseff

    changing registration point?

    birnerseff Level 2

      I have a libraray of symbols for use in flash, but unfortunately some have center registration point and some have top-left.

      I thought about

      - copying symbol to document

      - rename symbol

      + break link

      - create new symbol from the instance (where I can specify registration)

      - remove instance and old symbol

      All of tthe - item work as expected. Is there any script to achieve the "break link to symbol" functionality

       

      ... or could you imagine an entirely different way to do that?

        • 1. Re: changing registration point?
          CarlosCanto Adobe Community Professional & MVP

          here you go, I hope you have CS5, earlier versions are not supported. I hardcoded the registration to the Center, it can be changed to your needs if necessary. Also, all symbols are turned to "Movie Clip", there's no option to do "Graphic".

           

          open the document where your library is before running the script, make sure there are no symbol items in the canvas, other wise it will get messy.

           

          // script.name = fixSymbolRegistrationPoint;
          // script.description = fixes symbols mixed registration points; CS5 only.
          // script.required = an open document with at least one symbol;
          // script.parent = CarlosCanto // 03/04/12;
          // script.elegant = false;
          
          
          var idoc = activeDocument;
          
          
          fixSymbolRefPoint(idoc);
          
          
          function fixSymbolRefPoint(idoc){
                    var symbolos = [];
                    var symbolCount=idoc.symbols.length;
            
                    for (i=0; i<symbolCount; i++) {
                              symbolos.push(idoc.symbols[i]);
                    } 
          
          
                    for (j=0; j<symbolCount; j++) {
                              var simbolo = symbolos[j];
                              var simboloName = simbolo.name
                              idoc.symbolItems.add(simbolo);
          
          
                              simbolo.remove();
                              var mySymbol = idoc.groupItems[0];
                              //var dupSymbol = idoc.symbols.add(mySymbol, SymbolRegistrationPoint.SYMBOLTOPLEFTPOINT);
                              var dupSymbol = idoc.symbols.add(mySymbol, SymbolRegistrationPoint.SYMBOLCENTERPOINT);
          
          
                              dupSymbol.name = simboloName
                              mySymbol.remove();
                    }
          
          
          }
          
          • 2. Re: changing registration point?
            birnerseff Level 2

            Hi Carlos,

             

            thanks a lot, its working well.