QuoteFant that IS the problem! when you tried to store the effect method in 'method' it didn't work. all you were getting is what the method RETURNS which in every case is nil (or for some reason it was returning the arguments of the zoom_in method)! and is ran the method so you were seeing the effect, yes but it was not being run at the time you thought it was. but some p 'hello' commands befor the line
Checked that already and strangely enough, the methods are running when they should.
Quote(also note that the line in the demo is method(args) NOT method(*args))
and you will see that the effect is displayed BEFORE the print command
also you can't use args directly in a if statement you will get a type error (I don't know exactly what this means).
if args.nil?
will get a type error if you use extra arguments
a = args.nil?
if a
for some strange reason will not
I've tested both args and *args and I'm sure that's not the problem here. I used * args only twice. While getting the arguments from
Transition.new, and when passing them to the effect method. args holds the array, *args holds the contents of the array, that's how I understand it and it seems to work fine so far.
And the effect executed AFTER the print, I checked.
About using args directly, I doubt that's much of a problem, but I noticed something else. This is what I currently use:
no_args = args.nil? || args == []
no_args ? method : method(*args)
It made no difference (regarding using args directly in an if clause). But here, I'm also checking for an empty array as I got it once.
Quote
the code I posted WORKS you and call ANY of the effects with extra arguments you modify the default values I TESTED it at least TRY it before telling me it is not going to work, what you doing is NEVER going to work, who CARES if the method is longes by 10 lines it WORKS ans INTENDED!
just TRY it ok?
PS: the zoom_in and zoom_out effects are backwards in the demo zoom_in zooms out and vice versa.
You know, why didn't I try this earlier? Sorry about it, really. I'll try it and get back to you. btw, thanks for the help Ryex
EDIT: You're right, it works! Let's see what I'll do next...