When you paste ActionScript from the Help panel into your FLA or ActionScript file, you have to be careful about special characters. Special characters include special quotation marks (also called curly quotation marks or smart quotation marks). These characters are not interpreted by the ActionScript editor, so your code throws an error if you try to compile it in Flash.
You can determine that your quotation mark characters are special characters if they do not color-code correctly. That is, if all your strings do not change in color in the code editor, you need to replace the special characters with regular straight quotation mark characters. If you type a single or double quotation mark character directly into the ActionScript editor, you always type a straight quotation mark character. The compiler (when you test or publish a SWF file) throws an error and lets you know if there are the wrong kind (special quotation marks or curly quotation marks) of characters in your code.
|
NOTE |
|
You might also encounter special quotation marks if you paste ActionScript from other locations, such as a web page or a Microsoft Word document. |
Be cautious of proper line breaks when you copy and paste code. If you paste your code from some locations, the line of code might break in an improper location. Make sure that the color coding of your syntax is correct in the ActionScript editor if you think line breaks might be a problem. You might want to compare your code in the Actions panel to that in the Help panel to see if it matches. Try turning on Word Wrap in the ActionScript editor to help solve surplus line breaks in your code (select View > Word Wrap in the Script window, or Word Wrap from the Actions panel pop-up menu.)