Skip navigation
Currently Being Moderated

Serious bug in Autoformat within class file (CS6)?

Jul 10, 2012 4:39 PM

Tags: #flash #3.0 #actionscript #format #cs6 #ide #autoformat

If you put a block comment in front of a class declaration, autocomplete introduces a code-breaking semicolon

 

package {

     /**

     * If there is any text here the autocomplete breaks

     */

          public class Product extends MovieClip {

          private function doSomething() {

           }

     }

}

 

becomes

 

package {

     /**

     * If there is any text here the autocomplete breaks

     */

     public class Product extends MovieClip { ;

     private function doSomething() {

     }

}

}

 

and

 

package {

     /**

     * If there is any text here the autocomplete breaks

     */

     public class Product extends MovieClip

     {

          private function doSomething() {

           }

     }

}

 

becomes

 

package {

     /**

     * If there is any text here the autocomplete breaks

     */

     public class Product extends MovieClip;

     {

          private function doSomething() {

          }

     }

}

 

but

 

package {

     /**

     */

     public class Product extends MovieClip

     {

          private function doSomething() {

          }

     }

}

 

works just fine.

 

Am I missing something, or does Adobe not want us to comment our code?

 
Replies
  • kglad
    63,087 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 10, 2012 4:53 PM   in reply to xTLS

    Flash has an auto-formatting option if you are daring. But, be careful if you use auto-formatting. It can occasionally convert error-free code into problematic code. You can always use the undo command (edit > undo) to undo any problems caused by auto-formatting but, for the most part, I find it easier to maintain good formatting without using auto-format and risking the occasional problems.

     

    When you use auto-format on code that contains more than 100 lines, it is easy to over-look an auto-format induced problem. So, if I have a block of 20 or 30 lines of code that need to be formatted in the midst of many more lines of code, I may open a new fla and paste the code in the Actions panel and use auto-format. If the code looks good, I will paste the formatted code over the unformatted code and then test to make sure no errors were introduced in the formatting process.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points