draig_hand Posted September 18, 2009 Report Share Posted September 18, 2009 Hello all, I am trying to figure out a way to enable and disable a button depending on wether a video is in pause (enable) or play (disable) condition. I have tried to figure out if this can be done using only JavaScript coding but with no success. Can it be done with JS or is there a need to use ActionScript in the fla? (I hope not!). Please find the code below fyi. (Note it refers to external video_shell.fla, .flv and .swf files built using Adobe Flash CS3.) Can someone look at the code supplied and point me in the right direction please? Thanks very much. codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="490" height="367" id="video_shell" align="middle"> value="#e5e5e5" /> allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> I need something along the lines of: function enabledisable() { if(video is not playing) { document.getElementById('button').disabled = false; } else if (video is playing) { document.getElementById('button').disabled = true; } } Quote Link to comment Share on other sites More sharing options...
draig_hand Posted September 21, 2009 Author Report Share Posted September 21, 2009 Resolved it myself by cheating. I've placed the code below fyi. function disableButton() { var tempdur="a duration value from program"; if(myValue=incorrect) document.getElementById('button').disabled = false; else if((myValue=correct) setTimeout("document.getElementById('button').disabled = true;",1)&&setTimeout("document.getElementById('button').disabled = false;",tempdur); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.