I need to simulate an ON/OFF switch (which actives after been pressed down for over two seconds). So while the mouse button is pressed DOWN on a button graphic for two seconds the Main Timeline then starts to play again after the two second period so I can continue showing the sequence?
Thank you so much. This works perfect. I have been trying for ages to get this to work!
I didn’t know your software supports these commands - $(button.node).mousedown. This doesn’t appear to be in your manual. Is that correct or have i missed them?
button.node is the DOM element associated with the button, you can use JavaScript to bind events to it or change its styles… It’s not officially supported so we don’t document it.
$(button.node).mousedown is the way to bind mousedown event to button.node using jQuery library.
You recently helped me with the above issue - regards having JavaScript activate during a ‘mousedown’ press. I have been informed this does not work on an iPad. Is this true?
You can use pointerdown/pointerup events instead of mousedown/mouseup events to make it work on almost all modern browsers on computers or mobile devices.
// replace $(button.node).mousedown(function() { by
$(button.node).on('pointerdown', function() {
// replace $(document).mouseup(function() { by
$(document).on('pointerup', function() {