Skip to content

Instantly share code, notes, and snippets.

@anandnalya
Created August 4, 2011 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandnalya/1124420 to your computer and use it in GitHub Desktop.
Save anandnalya/1124420 to your computer and use it in GitHub Desktop.
‘protected’ implementation in Actionscript 3 is BROKEN
public class BaseClass{
public function modifyProperty(property:String, value:Object):void{
this[property] = value;
}
}
public class SubClass extends SubClass{
protected var count:int;
}
public function test():void{
var testObj:BaseClass = new SubClass();
testObj.modifyProperty('count', 3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment