When naming divs, images, symbols etc, in the properties window…can you name it anyway you want or is there a proper syntax, should you use hyphens or underscores or is that just for easier reading?
For instance my image name:
Radio Receiver 1
For what it is worth - here is my 2¢
I always use camel casing. This is making the first word start lowercase and each new word after that start uppercase. No spaces in between.
I think it is very important to use naming that accurately reflects the purpose or identity of the object.
I use camel casing and do not use spaces or symbols. If you have ever seen some URLs that have other characters you didn’t add to it such as %20 in them - this is why. Some applications cannot properly deal with spaces and symbols when they process links which can sometimes break things - so I work to avoid them altogether.
I am not saying it is wrong to use another convention - just offering my philosophy on why I do what I do.
Hope it helps.
For your information, Saola Animate doesn’t limit the ways to name elements. Users can name them however they like, and this name will be used to get the element through the function:
doc.getElement('name of element')
However, it’s advisable to choose a consistent naming style; for instance, you can follow the camelCase style, as @gregs does.
Thanks for that idea gregs, I have never tried that way, but it makes it quite readable and concise.
Thanks for this info Hang…I had a feeling we weren’t limited on how to name elements, because the program always seems to run smoothly no matter how I name the elements.