Flash: which characters are allowed in instance names?
Flash tells me that instance names must contain "alphanumeric开发者_C百科 characters, supported symbols, and no whitespace". I've found the underscore is allowed, but not the minus sign.
Does anyone have a definitive list of all supported symbols?
Quoting Adobe Livedocs
Instance names must conform to the following requirements:
- The name must not contain any spaces.
- The first character must be a letter, underscore (_), or dollar sign ($).
- Each subsequent character must be a letter, number, underscore, or dollar sign.
- The instance name must be unique.
i don't have such a list, but I suggest that you use camelCase for naming instances. Have the word start with a normal letter and whenever a new word starts, type the first letter of the word in a capital, like this: thisIsAnExample.
and i think only the underscore is allowed, since all the other signs are reserved for flash itself (-+*/% are for calculations, &|=!<> are for logic, . is for properties, so I guess that's most of the signs you would use in an instance-name).
edit: @ and \ are also reserved, so these signs can't be used aswell :)
a-z, A-Z, 0-9 and _ should suffice to name any variable or instance you need to (I don't think you can start a name with a number though). Any other symbols would start to make your code unreadable.
For naming conventions, there are a lot you can chose from. The Wiki article gives good info on this: http://en.wikipedia.org/wiki/Naming_conventions_(programming)
精彩评论