|
Can you not use options? Effect.EffectRequiringIndex = Class.create(); Object.extend(Effect.EffectRequiringIndex.prototype, Effect.BlindUp.prototype, Effect.BlindDown.prototype, Effect.Base.prototype); Object.extend(Effect.EffectRequiringIndex, { initialize: function(element, options) { Object.extend(new Effect.toggle.prototype(element, 'blind', Object.extend({ index:0 /* or set this based on some counter? */ },options||{})), this); }, .... beforeSetup: function(effect) { effect.index = effect.options.index; }, beforeStartInternal: function(effect) { effect.index = effect.options.index; } }; var i=5; new Effect.EffectRequiringIndex('elementid',{index:i}); Something like that maybe? I haven't extended any Effects before but I've done something similar to that before with IPEs. Not sure if that is what you want or not though. Depending on where you want to set i, you may not need to extend initialize. Colin Ian Tyndall wrote: Since I haven't received any responses yet, I thought I would go into more detail. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~--- |
- [Rails-spinoffs] Re: Adding custom variable to effect obj... Ian Tyndall
- [Rails-spinoffs] Re: Adding custom variable to effec... Michael Peters
- [Rails-spinoffs] Re: Adding custom variable to effec... Colin Mollenhour
