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? ![]()
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.
North America
Europe, Middle East and Africa
Asia Pacific