| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
Hi,
What is the convention for naming public static vars? I know public static conts look like this: ActionScript Code:
But is the all capital letters because is it static or because it is a constant? So what would be the convention for this: ActionScript Code:
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: May 2007
Location: Toronto,Canada
Posts: 345
|
Good question, as much as a know, you can't declare constant in Flash and they advise to name variables UPPERCASE as reminder: it is variable that you shouldn't change in future.
|
|
|
|
|
|
|
|
|
#3 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
AS 3.0 allows contsants just like the first code I posted.
question still out there.......
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#4 |
|
as[org].addListener(this)
Join Date: Dec 2005
Location: LA, California
Posts: 838
|
All caps is a convention for constant, not static. Static variables should still follow the same conventions as instance variables.
|
|
|
|
|
|
#5 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
ok....so I take it AS 2.0 use just trying to fake constants.
Thanks ![]()
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#6 |
|
as[org].addListener(this)
Join Date: Dec 2005
Location: LA, California
Posts: 838
|
Well, in AS 2.0 you'd just caps to differentiate between which values shouldn't be changed.
However I always liked to write my constants in AS 2.0 like this: ActionScript Code:
|
|
|
|
|
|
#7 |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
yea that makes sense. That's a nice approach for AS 2.0.
Thanks ![]()
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
#8 |
|
as[org].addListener(this)
Join Date: Dec 2005
Location: LA, California
Posts: 838
|
np d0000d
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| it creates the dynamic movieclips, problems assigning functions to them | Junior84 | ActionScript 2.0 | 7 | 05-10-2007 02:02 PM |
| class caching issue possibly? | binkyboo | ActionScript 2.0 | 1 | 01-29-2007 10:47 PM |
| static properties and methods | skjc | ActionScript 2.0 | 7 | 02-22-2006 04:33 PM |
| Help with KeyManager class | Slowburn | ActionScript 2.0 | 2 | 01-11-2006 10:39 PM |
| Getter & setters using AS2.0 | Taff | ActionScript 2.0 | 18 | 05-27-2005 06:45 PM |