In Delphi, I can type:
with CLASSNAME
property1 = xxx
property2 = yyy
etc.
without having to type
CLASSNAME.property1 = xxx
Is there a similar shortcut in AS3 to save my delicate fingers from excessive
typing?
Thanks
Bruce
Is there a similar shortcut in AS3 to save my delicate fingers from
excessive typing?
Yes, it's the with keyword... clever, huh? ;-)
Though, it's generally avoided because the scoping issues can be
unclear when reading the code.
Troy.
Right. I've always been wary of the with construct (VB.NET, which I used
to work in, has it), but it can be used rather elegantly:
private function populateNode(d:DataSprite):Boolean
{
var p:Particle = d.props.particle;
if (p == null) {
d.props.particle = (p =
3 matches
Mail list logo