You currently have Javascript disabled, to use some of the features (such as the login) you must enable it for this site
Trapping multiple mouse clicks for program control | Custom Buttons²

Trapping multiple mouse clicks for program control

Post & Get codes templates and info here

Postby squeaky on Sun Mar 30, 2008 12:13 pm

.
two mouse events demotwo mouse events demo


The demo button will do three different things. Related, but different.

Edit the showme variable in the "Code" tab to see each demo.

  1. Toggle between two functions (one per mouse click)

    Using the "checked" status the first click will run the first function. Second click will run the second.

    i.e. action is 1, 2, 1, 2, 1, 2 ...
    .
  2. Run a sequence of functions (one per mouse click)

    Using a home made attribute run through a sequence of functions of your choice. There can be as many different functions as you want to set up for.

    i.e action is 1, 2, 3, ... 1, 2, 3, ... 1, 2, 3, ...

    Obviously you could set the different functions to run dependent on conditions rather than just a straight sequence. i.e. the user clicks on your back/re-do object and steps back one function, or carries on forwards. Or your error checks need to send them back!
    .
  3. Preserve data through mouse clicks

    Using a home made attribute preserve any sort of data you like (such as a count or a setting or some other variable) so that you can carry on using that same data the next time you click the button.

Combining and/or 1, and/or 2, and/or 3, could give some real multi-functional control.

Doncha just love thinking outside the box? :)
Regards and stuff,
Richard.

CustomButtons2:- ver 2.0.7.5; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
User avatar
squeaky
Moderator
Moderator
 
Posts: 445
Joined: Sat Mar 01, 2008 8:48 am
Location: Sunny Suffolk

Return to Templates Codes & Tutorials

Who is online

Users browsing this forum: • Registered: 0 and 0 guests