Re: [Flashcoders] Passing a Function as Parameter and call function later

2007-02-18 Thread dr.ache
Hi. i guess you have a scope problem. for me, your code worked fine, here my adjustments to test it (i got one MC with a 180 frame MotionTween starting at 120 when loaded, on the stage, called fred. i simulated the function call with an interval, so the animation starts and after 2 seconds, your

Re: [Flashcoders] Passing a Function as Parameter and call function later

2007-02-18 Thread Felipe Hefler
Thank you dr.ache. Wasn't that the problem. Anyway your answer helped me a lot. See what solution I came up: function rew(m:MovieClip, f:Function) { m.onEnterFrame = function() { var cf:Number = m._currentframe; var tf:Number = m._totalframes; if (cf=tf cf1) {

Re: [Flashcoders] Passing a Function as Parameter and call function later

2007-02-18 Thread Wagner Amaral
I'm not testing, but you could use: f.call(); as long as f is a reference to a Function object On 2/18/07, Felipe Hefler [EMAIL PROTECTED] wrote: Thank you dr.ache. Wasn't that the problem. Anyway your answer helped me a lot. See what solution I came up: function rew(m:MovieClip,

Re: [Flashcoders] Passing a Function as Parameter and call function later

2007-02-18 Thread Felipe Hefler
I've tried it, and didn't work. Can you say how this reference should be? On 18/02/07, Wagner Amaral [EMAIL PROTECTED] wrote: I'm not testing, but you could use: f.call(); as long as f is a reference to a Function object On 2/18/07, Felipe Hefler [EMAIL PROTECTED] wrote: Thank you