> What does a dollar sign do at the beginning of a variable in Flash?
> Anything? like Stage.$blah = "rar";

It's legal, and benign, to prefix identifiers with '$'.

I use it in my code to identify the scope of a variable -- either _global
or class-specific (private). I find it useful to hang a '$_' prefix on
variables within a certain scope, not only to distinguish them a little,
but to make it easier to do certain things that utilize them, like create
accessor methods without having to invent a completely new name.

example:

private var $_someVariable:String;

public function get someVariable():String {
  return $_someVariable;
}

public function set someVariable(value:String):Void{
  $_someVariable = value;
}



-
pixelTwiddler, a.k.a. Jason

Respect yourself, and THINK about stuff.


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to