2 Replies Latest reply on Nov 12, 2007 1:20 PM by ORAN6E98

    deleting comment lines in CS3

    reinhat Level 1
      Hi,
      I have a simple question for you because I did not find any topic related to it. I have a web site with long lines of actionscript and all script lines are commented by using info with "//" before them.
      For example:
      //button actions:
      butAbout1.onRelease = function():Void {
      };

      How can I remove these commented lines and not just the comment "//" characters easily without having to delete them line by line manually?
      I only want to remove the "//" commented lines but not the "/*" ones. I also have some "/*" lines which should not be deleted.
      Thank you in advance,
      Attila
        • 1. Re: deleting comment lines in CS3
          sly one Level 1
          Simplest way is to use the Find/Replace dialog in the Action Pane in Flash and just find each instance of //, click the line number and delete the line. More advanced forum members may be able to tell you how to completely automate it in a code editor by creating a regular expression.
          • 2. Re: deleting comment lines in CS3
            ORAN6E98
            One option is to open the code in Dreamweaver or some other text editor that supports regular expression search and replace. The regular expression would be something like:

            "\/\/.*" (without quotes)

            Be careful though, the regular expression will match anything starting will "//" including URLs. If you are sure all of your comments start with a "//" and followed by a space, e.g. "// " you could change the regular expression to "\/\/ .*" (without quotes)