« Common GUI design m... xplsv.tv 2005 repor... »

Bizarre Actionscript #1

Feb 6th, 2006

Never create/use a variable/object with "3d" in the begining of the name ("3dXX"). It won't work.

#permalink

Share:
Digg! ~ del.icio.us ~ Stumble ~ Furl ~ Reddit
Actionscript follows ECMA4 specs mostly so in theory any variable starting with a number should fail I think.
Feb 6th, 2006
Andy
Thanks!
Nice to know that!
Feb 6th, 2006
mr.doob
now that i remember that's because of how the compilers are built... everything which begins with a number is a number and will be evaluated like that... anything else might be considered
Feb 6th, 2006
sole
I see, I guess is for optimizations then...
Feb 6th, 2006
mr.doob
well know that you are curious about it... compilers have a series of possible status when evaluating the input tokens, so they need to distinguish if each token is a variable, a reserved word or whatever, and if the syntax is ok too.
And that's what a parser does :D
Checks the type of each token and verifies if it is in a proper position.
Feb 6th, 2006
sole
Como nomenclaturas hay millones, te explico la mia para las variables:

- si es un númerico será nVariable
- si es un string será sVariable
- si es un objeto será oObjeto
- si es un array será aArray
- si es "booleano" será bVariable

... creo que así me evito algunos errores en los nombres y a veces hasta comprendo mi codigo despues de meses... pero solo a veces... :D
Feb 6th, 2006
humphr3y
Notación humpr3yhúngara 8)
Feb 6th, 2006
r3d
Webs / Print / Logos... everything I do will be listed here.



If you're looking for my Actionscript experiments, here you have: