Other way around actually
function show(jump){
this.fx[(jump)?'set':'start']('height',100).chain(
this.doSomething.bind(this) );
};
On Tue, Mar 2, 2010 at 12:32 AM, Roman Land <[email protected]> wrote:
> The reason I had this issue was due to what I was doing in my code:
>
> function show(jump){
> this.fx[(jump)?'start':'set']('height',100).chain(
> this.doSomething.bind(this) );
> };
>
> So now that I understand I can not do this due to design, I will use
> switch()... still my logic tells me that if fx supports chaining (according
> to docs) I should be able to use it with .set as well.
>
>
> On Tue, Mar 2, 2010 at 12:22 AM, Christoph Pojer <
> [email protected]> wrote:
>
>> This is indeed by design.
>>
>> As set executes immediately you can call "callChain()" after the call
>> to set: tween.set(..).chain(fn).callChain() (which does not make a lot
>> of sense as you can just call the function in the next line too).
>>
>> Adding functions to the chain queues them until the next call of
>> callChain. so myChain.chain(fn1).chain(fn2); executes fn1 and fn2 only
>> when callChain is called.
>>
>> tween.set(..).chain(fn1);
>>
>> tween.start(..)
>>
>> calls fn1 after the animation has completed (initiated via .start)
>>
>> On Feb 28, 2:11 pm, Roman Land <[email protected]> wrote:
>> > Hi,
>> >
>> > To show you what I mean, read the code and follow three steps in the
>> > mooshell:http://mootools.net/shell/UPevc/
>> >
>> > I checked the code and I see that when Fx.Tween.set is used, the Fx.step
>> is
>> > never called (for obvious reasons) and the "complete" event is never
>> fired,
>> > thus the chained functions are never called..
>> >
>> > In the code this is by design, but in reality I want to keep my code
>> clean
>> > and simple and I sometimes switch between .set and .start for the Tween
>> > effect.
>> > As you can see in the mooshell, there's a weird buggy side effect that
>> > happens due to the .chain registering with the chained functions array
>> but
>> > never fired (as mentioned above)
>> >
>> > Nothing in the documentation mentions no chain support for Fx.Tween.set,
>> so
>> > this is either a documentation erreta or unwanted behavior...
>> >
>> > Happy coding!
>> > Roman
>> >
>> > --
>> > ---
>> > "Make everything as simple as possible, but not simpler."
>> >
>> > - Albert Einstein
>>
>
>
>
> --
> ---
> "Make everything as simple as possible, but not simpler."
>
> - Albert Einstein
>
>
--
---
"Make everything as simple as possible, but not simpler."
- Albert Einstein