[flexcoders] Custom AS2 Effects
Hi Folks, Does anyone know why the following custom effect class which I am trying to use to call various functions in an effect sequence would cause the sequence to halt after running the called function. Thanks Mike. import mx.effects.Effect; class com.webqem.flex.effects.CallFunctionEffect extends Effect { private var obj:Object; private var func:String; private var args:Array; function CallFunctionEffect(obj:Object, func:String) { this.obj = obj; this.func = func; arguments.shift(); arguments.shift(); this.args = arguments; } public function playEffect():Void { if (obj != null && func != null) { obj[func].apply(obj, args); } } public function getAffectedProperties():Array { return new Array(); } } Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Custom AS2 Effects
Mike, Add listener.onEffectEnd(this); to the end of your playEffect function. This will tell the Sequence effect that the effect is finished playing. The Sequence effect sets itself as the listener of each of its child effects. Jason -Original Message- From: Mike Shaw [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 30, 2005 11:01 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Custom AS2 Effects Hi Folks, Does anyone know why the following custom effect class which I am trying to use to call various functions in an effect sequence would cause the sequence to halt after running the called function. Thanks Mike. import mx.effects.Effect; class com.webqem.flex.effects.CallFunctionEffect extends Effect { private var obj:Object; private var func:String; private var args:Array; function CallFunctionEffect(obj:Object, func:String) { this.obj = obj; this.func = func; arguments.shift(); arguments.shift(); this.args = arguments; } public function playEffect():Void { if (obj != null && func != null) { obj[func].apply(obj, args); } } public function getAffectedProperties():Array { return new Array(); } } Yahoo! Groups Links Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Custom AS2 Effects
Thanks Jason, that nailed it. I had played around with the event but not got it right. It's so obvious when I see your solution. Cheers Mike. From: Jason Szeto [mailto:[EMAIL PROTECTED] Sent: Friday, 1 April 2005 5:21 AMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Custom AS2 Effects Mike,Add listener.onEffectEnd(this);to the end of your playEffect function. This will tell the Sequence effectthat the effect is finished playing. The Sequence effect sets itself as thelistener of each of its child effects. Jason-Original Message-From: Mike Shaw [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 30, 2005 11:01 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Custom AS2 EffectsHi Folks,Does anyone know why the following custom effect class which I am trying touse to call various functions in an effect sequence would cause the sequenceto halt after running the called function.Thanks Mike.import mx.effects.Effect;class com.webqem.flex.effects.CallFunctionEffect extends Effect { private var obj:Object; private var func:String; private var args:Array; function CallFunctionEffect(obj:Object, func:String) { this.obj = obj; this.func = func; arguments.shift(); arguments.shift(); this.args = arguments; } public function playEffect():Void { if (obj != null && func != null) { obj[func].apply(obj, args); } } public function getAffectedProperties():Array { return new Array(); }}Yahoo! Groups Links Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.