call handler from Scene_MenuBase

I'm using KMS Distribute Parameters script. https://forums.rpgmakerweb.com/index.php?threads/kms-distribute-parameter.3802/

I've changed the functions of the page down and page up to bring up new windows.
Code:
    @parameter_window.set_handler(:pagedown, method(:on_next_ok))#(:next_actor))
Code:
  def on_next_ok
    next_confirm
  end
Code:
  def next_confirm
    @status_window.refresh
    @next_window.index  = 0
    @next_window.activate
    @next_window.open
    @parameter_window.deactivate
  end
Code:
  def create_next_window
    @next_window = Window_DistributeParameterNext.new(0, 0)
    @next_window.x = (Graphics.width  - @confirm_window.width)  / 2
    @next_window.y = (Graphics.height - @confirm_window.height) / 2
    @next_window.z = 300#@help_window.z
    @next_window.viewport    = @viewport
    @next_window.openness    = 0
    @next_window.deactivate
    @next_window.set_handler(:decide, method(:on_next_decide))
    @next_window.set_handler(:cancel, method(:on_next_cancel))
  end
The problem is that after I select to switch actors from the window it goes back to the current actor, because the command to switch actors is not given.
I have not been able to find a way to give the command for
Code:
method(:next_actor)

If I set the command for the window to next actor
Code:
    @next_window.set_handler(:decide, method(:next_actor))#(:on_next_decide))
then the window does not close, but it goes to the next actor.
If I use
Code:
    @next_window.set_handler(:decide, method(:on_next_decide))
the window closes, but it does not switch to the next actor.
Code:
  def on_next_decide
#~     return Input.press?(:pagedown)
    command_next
    return method(:next_actor)
  end
Code:
  def command_next
    @next_window.deactivate
    @next_window.close
    @parameter_window.activate
  end

Been at this for a while and need some advise.
If I set the command for the window to next actor
Code:
@next_window.set_handler(:decide, method(:next_actor))#(:on_next_decide))
then the window does not close, but it goes to the next actor.
Have you consider to overwrite how "next_actor" method works so that it will close the window?
This:
Code:
return method(:next_actor)
Just returns the method itself, but it will not execute it.
You can simply call it by using it's name in any method found in the same class (just like you do with any other methods, really), so you can replace that line with this:
Code:
next_actor
And it should switch to the next actor, although I have no idea what you want your window to do exactly, so I can't be sure if it will work for you or not.
This:

Code:
next_actor
Thank you @Sixth It work perfect.

The idea is with this script is that you can turn reverse of stat distribution off so that when you put points in they are permanent.
With my modifications, I get a window to pop up asking "save & go to next actor" or Cancel, when pressing pageup or down.
also when pressing (on keyboard) Z or X you get asked save stats, to which will save the current point distribution.

This came from one issue I found with the script - when you allocate points and then switch to another actor the points you set in the actor is removed. So you had to save the stats then switch actors to make it set. I also have a solution that doesn't use the windows and saves the stats, but then the player would not know that it's going to save and might be angry with the change.

Now I just need to clean up the commented mess I have in the script.

Thank you again. I knew you would have the simple answer but I did not understand as all I saw were things like what I had in there.

Original thread: https://forums.rpgmakerweb.com/threads/call-handler-from-scene_menubase.90703/