Usage of the Proxy class
April 29th, 2005 by ThomasI felt like posting this here, because I keep forgetting how to use Luis' very helpful Proxy class...
Actionscript:
- import lessrain.lib.utils.Proxy;
- class MyClass
- {
- private var _sProperty:String;
- public function SomeClass(sURL:String)
- {
- var lvInstance:LoadVars = new LoadVars();
- // Tell Flash to call the assignText( ) method using this as the scope.
- lvInstance.onData = Proxy.create(this, assignText);
- lvInstance.load(sURL);
- }
- // Since the assignText( ) method is called with the this scope, _sProperty is defined.
- private function assignText(sText:String):Void
- {
- _sProperty = sText;
- }
- }



May 5th, 2005 at 5:41 pm
There is a new Proxy class on the cvs.
December 14th, 2005 at 11:05 pm
Hi,
Can you tell me a bit more about the use of the Prxy Pattern? I read that a proxy functions like a kind of substitude for another object. Sort of temporary replacement. But I con’t figure out what the proxy does here.
great blog Lessrain