OnClick Question

 4 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
Chris12
Veteran Member Send Private Message
Posts: 150
Veteran Member
I have a screen in DS which contains multple buttons.  I would like to have multiple onClick events (one for each button) .... How do I segrate the onClick events such that each button knows what OnClick function to use ... This one is killing me
Robert Spurr
Veteran Member Send Private Message
Posts: 130
Veteran Member
the OnClick button has a variable call 'id'. Every object in design studio is assigned an 'id'. For buttons it will something like 'push7'. All you need to do check the the 'id' to determine the action you want to take. if(id=="push7") { //Do something }
Chris12
Veteran Member Send Private Message
Posts: 150
Veteran Member
Thanks Robert .... But how to a link the button to the function .... It seems when I click the button (ie push 7) it does nothing
Terry P
Veteran Member Send Private Message
Posts: 234
Veteran Member
With the button you're trying to use, click on the Properties for it. You'll see at the bottom "Action". When you open that, then typically you'll click the radio option for "Function". When you do that, all your custom functions are listed. Create a function you want to execute when the button is pushed.
Chris12
Veteran Member Send Private Message
Posts: 150
Veteran Member
Thanks all .... in my if statement I only had "=" and not "==" .... Thanks so much