PDA

View Full Version : Change Button onclick event


dflowers
08-27-2008, 03:09 PM
Is there a way to change the onclick event of a button based on another button? Let me explain. I would like to press button A and have it change the onlcick event (web.LoadUrl) of button E to a different url. If I press button B then it would change button E to another url, etc. I know I can set properties etc, but I have not been able to find anything in the help file that would allow me to change the OnClick events.

Ulrich
08-27-2008, 04:01 PM
Why not place the URL in a variable, and change the contents of that variable when button A or B is clicked?

Ulrich

dflowers
08-27-2008, 05:28 PM
Never thought of that, thanks for the help.:yes

Pazan
02-16-2009, 07:12 AM
Why not place the URL in a variable, and change the contents of that variable when button A or B is clicked?

Ulrich
So, I have some different trouble. My project has a lot of video files (~240).
there are buttons with digit from "1" to "10".
when user explores web-pages in WebObject "On Navigate" this code are working

if (e_URL == _SourceFolder.."\\AutoPlay\\Docs\\graph_task\\task_04_2_01_01.html") then
Button.SetVisible("Button_task_04_2_01_01", true);
else
Button.SetVisible("Button_task_04_2_01_01", false);
end
...
...
if (e_URL == _SourceFolder.."\\AutoPlay\\Docs\\graph_task\\task_04_2_24_10.html") then
Button.SetVisible("Button_task_04_2_24_10", true);
else
Button.SetVisible("Button_task_04_2_24_10", false);
end
-- and like that


that's mean this code repeat 240 times but with 240 button object:wow

Is possible to replace OnClick script in buttons with digit from "1" to "10" when URL will change via


f (e_URL == _SourceFolder.."\\AutoPlay\\Docs\\graph_task\\task_04_2_01_01.html") then
...
else
...
end


Thanx;)

Gekkepop
02-21-2009, 12:01 PM
were or how can i refer a new button to something.

longedge
02-21-2009, 12:13 PM
were or how can i refer a new button to something.

It gets confusing and makes the forum difficult to search if you ask new questions in post but anyway -

If you look at the properties for a button you'll see a "Script" tab. In there you will see the events that relate to the button - On Click, On Right-Click, On Enter and On Leave. You put code into those events and it 'fires' when that event occurs on that object.