[Tweener] Tweener Digest, Vol 17, Issue 15
Makc
makc.the.great at gmail.com
Sun May 18 23:22:36 PDT 2008
you should have passed "free" function not class method. i.e., something like:
public class My {
var func:Function = function () {
// do stuff with "this"
}
public function tweenLauncher () {
Tweener.addTween (.... onComplete:func ... );
}
}
an not like:
public class My {
public function func () {
// this is tied to "My" forever
}
public function tweenLauncher () {
Tweener.addTween (.... onComplete:func ... );
}
}
On 5/19/08, Mitchell Hudson <soggybag at gmail.com> wrote:
> Thanks, everything works using onCompleteParameters.
>
> Using this, in a function called by onComplete, doesn't give me the
> target movie clip. By target movie clip, I'm referring to the clip
> that was tweened. Instead I get Class that created the tween. Which
> makes sense, but doesn't sound like what you were describing.
>
> --M
>
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Sun, 18 May 2008 18:20:18 -0700
> > From: "Mitchell Hudson" <soggybag at gmail.com>
> > Subject: [Tweener] How to get to the Tweener target via onComplete
> > To: tweener at lists.caurinauebi.com
> > Message-ID:
> > <cbaee75c0805181820g5d141ae5ib448c11062e7c946 at mail.gmail.com>
> > Content-Type: text/plain; charset=ISO-8859-1
> >
> > I'd like to reference the target of a tween through the call to
> > onComplete. Is this possible?
> >
> > It seems that the onCompleteParams would be one method. Does, this
> > provide a single parameter to the onComplete function that is an
> > array? For example:
> >
> > Tweener.addTween( _mc, { alpha:1, time:1, onComplete:test,
> > onCompleteParams:[ _mc ] } );
> > function test( _array ) {
> > trace( _array[0] ); // The object that just completed the tween
> > }
> >
> > Is the idea or am I missing something?
> >
> > Or is there a better way? I keep thinking there might be a way to
> > access the target object of the tween.
> >
> >
> > ------------------------------
> >
> > Message: 2
> > Date: Sun, 18 May 2008 22:40:27 -0300
> > From: Zeh Fernando <zehfernando at zeh.com.br>
> > Subject: Re: [Tweener] How to get to the Tweener target via onComplete
> > To: tweener at lists.caurinauebi.com
> > Message-ID: <4830DA8B.1000506 at zeh.com.br>
> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> >
> >
> >
> > Mitchell Hudson wrote:
> >> I'd like to reference the target of a tween through the call to
> >> onComplete. Is this possible?
> >>
> >> It seems that the onCompleteParams would be one method. Does, this
> >> provide a single parameter to the onComplete function that is an
> >> array? For example:
> >>
> >> Tweener.addTween( _mc, { alpha:1, time:1, onComplete:test,
> >> onCompleteParams:[ _mc ] } );
> >> function test( _array ) {
> >> trace( _array[0] ); // The object that just completed the tween
> >> }
> >>
> >> Is the idea or am I missing something?
> >>
> >> Or is there a better way? I keep thinking there might be a way to
> >> access the target object of the tween.
> >
> > You can access the object of the tween with a "this", since it's the
> > scope from within the function is ran.
> >
> > function test() {
> > trace( this );
> > }
> >
> > Using onCompleteParams work, but it's passed as an array and received as
> > *arguments*, so the correct code for your example above to work would be
> > this:
> >
> > function test( mc ) {
> > trace( mc );
> > }
> >
> >
> > Zeh
> >
> >
> > ------------------------------
> >
> > _______________________________________________
> > Tweener mailing list
> > Tweener at lists.caurinauebi.com
> > http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
> >
> >
> > End of Tweener Digest, Vol 17, Issue 15
> > ***************************************
> >
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
More information about the Tweener
mailing list