For quite some time I use the following code to control, behaviors of some buttons and other content:
for (var i in this) {
if (this*._name.substr(0, 4) == "btn_") {
setKnop(this*._name);
}
}
function setKnop(clip) {
var clip = eval(clip);
clip.onRollOver = function() {
new Color(clip).setRGB(0x000000);
};
Etc, etc.
I used this code because somebody adviced me to do so. So in this case btn_ is always followed by some other name. Now I bought the book Foundation actionscript from FriendsOfEd and they advice to use btn as a suffix “_btn” as well as Colin Moock did in his book Actionscript the definite guide.
Is there somebody who can explain me a little bit more about the use of “_name, substr” etc
What i would like to find out is how the this code:
_name.substr (0, 4)
would look like if I start working with btn as suffix, as the adviced in the mentioned books?
Thanks in advance