I''m working on creating a small progress meter using Scriptaculous and the behavior of that meter is such that when it reaches 100% an action occurs and then it returns to 0% and starts over again. I thought that it might be as simple as setting a function to the objects afterFinish property that would reset the bar''s position and then call the effect''s start() method. For now, I''ve been able to produce the effect I need by creating a new Effect within the afterFinish handler of the old one, but I''m worried that this could make browsers suffer a slow and grueling death as these objects are created in memory. Is there a better way? David Kees --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Why not have the effect in a function and just call the function again in afterFinish instead of nesting them? On Apr 9, 1:34 pm, dashifen <dashi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m working on creating a small progress meter using Scriptaculous and > the behavior of that meter is such that when it reaches 100% an action > occurs and then it returns to 0% and starts over again. I thought > that it might be as simple as setting a function to the objects > afterFinish property that would reset the bar''s position and then call > the effect''s start() method. > > For now, I''ve been able to produce the effect I need by creating a new > Effect within the afterFinish handler of the old one, but I''m worried > that this could make browsers suffer a slow and grueling death as > these objects are created in memory. Is there a better way? > > David Kees--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
That is what I''m doing, but the function creates a new Effect object every time the function is called. I''m not sure if there''s a way to instantiate one Effect object and re-use it consistently rather than making new ones. - Dave - On Apr 9, 1:00 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Why not have the effect in a function and just call the function again > in afterFinish instead of nesting them? > > On Apr 9, 1:34 pm, dashifen <dashi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m working on creating a small progress meter using Scriptaculous and > > the behavior of that meter is such that when it reaches 100% an action > > occurs and then it returns to 0% and starts over again. I thought > > that it might be as simple as setting a function to the objects > > afterFinish property that would reset the bar''s position and then call > > the effect''s start() method. > > > For now, I''ve been able to produce the effect I need by creating a new > > Effect within the afterFinish handler of the old one, but I''m worried > > that this could make browsers suffer a slow and grueling death as > > these objects are created in memory. Is there a better way? > > > David Kees--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
There''s a patch that does just that - allows an Effect to produce a reusable instance. http://dev.rubyonrails.org/ticket/11054 - kangax On Apr 9, 2:22 pm, dashifen <dashi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That is what I''m doing, but the function creates a new Effect object > every time the function is called. I''m not sure if there''s a way to > instantiate one Effect object and re-use it consistently rather than > making new ones. > > - Dave - > > On Apr 9, 1:00 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Why not have the effect in a function and just call the function again > > in afterFinish instead of nesting them? > > > On Apr 9, 1:34 pm, dashifen <dashi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I''m working on creating a small progress meter using Scriptaculous and > > > the behavior of that meter is such that when it reaches 100% an action > > > occurs and then it returns to 0% and starts over again. I thought > > > that it might be as simple as setting a function to the objects > > > afterFinish property that would reset the bar''s position and then call > > > the effect''s start() method. > > > > For now, I''ve been able to produce the effect I need by creating a new > > > Effect within the afterFinish handler of the old one, but I''m worried > > > that this could make browsers suffer a slow and grueling death as > > > these objects are created in memory. Is there a better way? > > > > David Kees--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Awesome. I''ll look into that. On Apr 9, 4:12 pm, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> There''s a patch that does just that - allows an Effect to produce a > reusable instance.http://dev.rubyonrails.org/ticket/11054 > > - kangax > > On Apr 9, 2:22 pm, dashifen <dashi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > That is what I''m doing, but the function creates a new Effect object > > every time the function is called. I''m not sure if there''s a way to > > instantiate one Effect object and re-use it consistently rather than > > making new ones. > > > - Dave - > > > On Apr 9, 1:00 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Why not have the effect in a function and just call the function again > > > in afterFinish instead of nesting them? > > > > On Apr 9, 1:34 pm, dashifen <dashi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I''m working on creating a small progress meter using Scriptaculous and > > > > the behavior of that meter is such that when it reaches 100% an action > > > > occurs and then it returns to 0% and starts over again. I thought > > > > that it might be as simple as setting a function to the objects > > > > afterFinish property that would reset the bar''s position and then call > > > > the effect''s start() method. > > > > > For now, I''ve been able to produce the effect I need by creating a new > > > > Effect within the afterFinish handler of the old one, but I''m worried > > > > that this could make browsers suffer a slow and grueling death as > > > > these objects are created in memory. Is there a better way? > > > > > David Kees--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---