Re: [Flashcoders] Using the $ sign at the beginning of a variable

2006-01-12 Thread Mike Britton
Nothing in particular - just a style of naming vars.  I don't do it
because it looks too much like PHP and I get disoriented.

I recall seeing this technique used to distinguish public from private
vars, but I think it went out of favor when AS2 came out.



On 1/12/06, Ryan Luce [EMAIL PROTECTED] wrote:
 What does a dollar sign do at the beginning of a variable in Flash?
 Anything? like Stage.$blah = rar;
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
Mike
--
http://www.mikebritton.com
http://www.mikenkim.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Using the $ sign at the beginning of a variable

2006-01-12 Thread Merrill, Jason
I've also seen people use $ for string variables.  As far as
Actionscript is concerned, it's just a style of coding, really.  

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com










-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Jason Lutes
Sent: Wednesday, January 11, 2006 9:09 PM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Using the $ sign at the beginning of a
variable

 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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
NOTICE:
This message is for the designated recipient only and may contain privileged or 
confidential information. If you have received it in error, please notify the 
sender immediately and delete the original. Any other use of this e-mail by you 
is prohibited.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders