Sure, here goes:
First of all, this is an action script, which means that it responds to some event that occurs on a component. In this case, we want to respond to the mouseExited event of your slider component, which will fire, not surprisingly, whenever the mouse exits the vicinity of the slider.
Ok, now line by line:
window = fpmi.gui.getParentWindow(event)
All action scripts start with one variable already defined: event. This object describes the event that occured, including the component that it occured on (event.source). fpmi.gui.getParentWindow is a built in function that takes an event object, and returns to you a reference to the window that the event took place in. (There are lots of built in functions - see the documentation under Technical Reference / Jython / Built-in Modules for more info.) We take that window reference and assign it to a variable called window
button = window.rootContainer.getComponent("CloseButton")
window.rootContainer is a reference to your window’s root container. All containers have a function called getComponent which takes a name of a component. In this case, we are assuming that your close button is called “CloseButton” and is on your root container. If either of those assumtions is wrong, this won’t work. If the assumtions are correct, then we will get a reference to your button component. We assign that reference to a variable called button. Note - we had to put CloseButton in quotes because it is a string - the name of a component. If we didn’t have quotes, the scripting engine would think that we wanted to pass the value of a variable named CloseButton to the getComponent function. Of course, we don’t have a variable named CloseButton, so this would be incorrect.
button.requestFocusInWindow()
This simply calls the requestFocusInWindow() function on the button.
Side note:. Lets assume that your slider was on the root container, right next to the CloseButton. Then we could have replaced the first 2 lines with this:
button = event.source.parent.getComponent("CloseButton")
…or this
button = fpmi.gui.getSibling(event, "CloseButton")
If terms like variable and function are foreign to you, then you probably want to go ahead and read an introductory tutorial to Python like:
http://en.wikibooks.org/wiki/Non-Programmer’s_Tutorial_for_Python/Contents or
http://www.dickbaldwin.com/tocpyth.htm or
http://docs.python.org/tut/tut.html.
Hope this helps!