set() is used for each step of the transition, so it can't just fire the
complete event because it would fire a lot of times when using a regular
start() and you don't want that.
It could be changed to something like, where _set() is a private set method
set: function(){
this._set(...).fireEvent('complete');
}
but that would break compatibility in a lot of places which you don't want
either.
Besides when using set() you already know when it's ready, right after
calling set(), so you don't need an event to tell you when set() is
complete. From that point of view the event isn't really necessary.
On Thu, Jan 20, 2011 at 11:04 AM, stratboy <[email protected]> wrote:
> mmmm, hey, yes. good. thank you.
>
> Anyway, (for the developers) it would be nice if this was builtin.
> Eventually if there's the need sometimes to not to broadcast the
> event, well, make it optional in the set() arguments.
>
>
>
> On 20 Gen, 10:58, Arian Stolwijk <[email protected]> wrote:
> > Or you could use
> >
> > fx.fireEvent('complete');
> >
> > On Thu, Jan 20, 2011 at 10:52 AM, stratboy <[email protected]> wrote:
> > > Hi! It's quite strange to me. Why?
> > > I have a function that, based on a param (fx), calls Fx.Scroll.start()
> > > or .set(). But in both cases, a listener on the onComplete event
> > > should be called... If I use set, the event just isn't broadcasted.
> > > Therefore, to achieve the same goal, I had to do something like this:
> >
> > > if(!fx){
> > > this.scroller.setOptions({ duration:0 })//to
> > > simulate set()
> > > this.scroller.start(pos,0);
> > > this.scroller.setOptions({ duration:500 })//to
> > > restore original duration
> > > }
> > > else this.scroller.start(pos,0);
> >
> > > Not to good right?
> >
> > > Any idea?
>