First off, action_name will only equal "selected_page" for the first button. The second button will return "pages1.selected_page" for action_name, and the third button will return "pages2.selected_page", so the equality check needs help. Second, there's probably an easier way to accomplish things.
The general form for callbacks is
add_action_callback(callback_name) {|dialog,parameters| action}
callback_name is the name of the callback. In your case, a good callback name might be "show_scene".
dialog will return the active dialog object.
parameters will return any parameters you send, and can be used just like the GET method for submitting forms. Of course, you could send a simple parameter like "scene1".
action should ideally call a method in your class, rather than trying to handle everything right there, unless it's a really short action.
...
@@xzybit_dlg.add_action_callback("select_page") {|web_dialog,page| show_page(page)}
...
def show_page(page)
pages = Sketchup.active_model.pages
pages.selected_page = pages[page]
end
...
#javascript
function showPage(page) {
query = 'skp;show_page@' + page;
window.location.href = query;
}
...
#html
<input type="button" onclick="showPage('Scene1') value = "Scene1">
<input type="button" onclick="showPage('Scene2') value = "Scene2">
<input type="button" onclick="showPage('Scene3') value = "Scene3">
Now, you may be trying to accomplish other things besides just activating a scene. Just add more callbacks and methods. It's often easier than trying to create a do-everything callback, unless the actions are very similar.