javascript - Using shift key and click to go to the next slide -
javascript - Using shift key and click to go to the next slide -
hei guys, added these lines of code javascript on succes of click box in captivate :
document.onkeydown = function (e) { if (e.keycode == 16) { document.captivate.cpeisetvalue('m_varhandle.cpcmndgotoslide', 5); } };
it after first atempt if im on slide , press shift key goes slide 5 :( question is, how set mousedown , onkeyup event on same button. seek accomplish jump next slide if press shift key , click on click box.
edit: new code:
document.onmousedown = function (e) { var currentslide = document.captivate.cpeigetvalue('m_varhandle.cpinfocurrentslide'); if(currentslide == 5 && e.keycode == 16){ document.captivate.cpeisetvalue('m_varhandle.cpcmndgotoslide' , 5); } };
as think it, should fire function when click on it, buuut , unfortunately doesnt work... seems captivate doesnt recognize onmousedown event :|
re-edit : figurate out how create work. here's code :
document.onkeydown = function(e) { var currentframe = document.captivate.cpeigetvalue('m_varhandle.rdinfocurrentframe'); var currentslide = document.captivate.cpeigetvalue('m_varhandle.cpinfocurrentslide'); if(currentslide == 5 && e.keycode == 16){ document.captivate.cpeisetvalue('m_varhandle.rdcmndgotoframeandresume' , 491); } }; document.onkeyup = function(e) { var currentslide = document.captivate.cpeigetvalue('m_varhandle.cpinfocurrentslide'); if(currentslide == 5){ document.captivate.cpeisetvalue('m_varhandle.rdcmndgotoframeandresume' , 485); } };
now everything's perfect! wanted do... works on localhost... when press f12 in captivate :( if seek run exported swf or html captivate crunch :((( ideea ?
var slide = 4; document.onkeydown = function (e) { if (e.keycode == 16) { slide++; document.captivate.cpeisetvalue('m_varhandle.cpcmndgotoslide', slide); } };
bassically want increment position (second argument of cpeisetvalue
), in code, set 5. create sure reset when reaches max slider position.
javascript jquery adobe-captivate
Comments
Post a Comment