I'm not sure whether that would work.
the following code actually does work but I hopped there is an easier
way to do it:
/*
if (this.options.preload) {
var callback = new Chain();
this._preload(callback);
callback.chain (
function() {
this.setUp();
}.bind(this)
)
} else {
this.setUp();
}*/
On Apr 26, 5:17 pm, "asgaroth.belem" <[email protected]> wrote:
> I think all you have to do is (not sure, sorry for any mistakes):
>
> this.function1().chain(this.function2());
>
> thats what chain is for, it wont execute function2 until function 1
> has ended. at least is what I think, i dont really use chain much.
>
> On 26 abr, 18:38, mmjaeger <[email protected]> wrote:
>
> > Hello
> > Hope somebody can help - I'm struggling with chaining two functions
>
> > this is the code I got:
>
> > this.function1().chain(
> > function() {
> > this.function2();
> > }
> > );
>
> > function1 has an onComplete event - like this:
>
> > I put the following in there:
>
> > onComplete: function() {
> > this.callChain();
>
> > }
>
> > function1 is basically a function to preload some image - when they
> > are loaded, I like to continue to execute function2.
>
> > Thank you in advance for your help.
>
> > What am I missing?