Once again, talking about code makes me all giddy, and gets me to log in.
I use the H*R Greasemonkey plugin constantly, but for those few times a day that I'm not watching toons on HR this one bit of javascript add a seekbar and pause button and works for just about all .swf toons. Works best if you put it into your favorites list:
Code:
javascript:(function(){setTimeout(initFlashControls,100);function initFlashControls(){var count=0;function tt(elem){if(typeof elem.TotalFrames!=%22undefined%22){addFlashControls(elem);++count;}}var i,x;for(i=0;x=document.getElementsByTagName(%22object%22)[i];++i)tt(x);for(i=0;x=document.getElementsByTagName(%22embed%22)[i];++i)tt(x);if(!count)alert(%22No scriptable flash on this page.%22);}function addFlashControls(flash){var controlsDiv=document.createElement(%22div%22);var where=flash;while(where.parentNode.tagName.toLowerCase()==%22object%22)where=where.parentNode;where.parentNode.insertBefore(controlsDiv,where.nextSibling);var table=document.createElement(%22table%22);controlsDiv.appendChild(table);var row=table.insertRow(-1);var pauseButton=document.createElement(%22button%22);pauseButton.appendChild(document.createTextNode(%22Pause%22));var buttonCell=row.insertCell(-1);buttonCell.appendChild(pauseButton);var slider=row.insertCell(-1);slider.width=%22100%%22;var visibleSlider=document.createElement(%22div%22);visibleSlider.style.position=%22relative%22;visibleSlider.style.height=%2210px%22;visibleSlider.style.width=%22100%%22;visibleSlider.style.MozBorderRadius=%224px%22;visibleSlider.style.background=%22#aaa%22;slider.appendChild(visibleSlider);var thumb=document.createElement(%22div%22);thumb.style.position=%22absolute%22;thumb.style.height=%2220px%22;thumb.style.width=%2210px%22;thumb.style.top=%22-5px%22;thumb.style.MozBorderRadius=%224px%22;thumb.style.background=%22#666%22;visibleSlider.appendChild(thumb);var sliderWidth;var paused=false;var dragging=false;table.width=Math.max(parseInt(flash.width)||0,400);addEvent(pauseButton,%22click%22,pauseUnpause);addEvent(slider,%22mousedown%22,drag);addEvent(slider,%22drag%22,function(){return false;});window.setInterval(update,30);function pauseUnpause(){paused=!paused;pauseButton.style.borderStyle=paused?%22inset%22:%22%22;if(paused)flash.StopPlay();else flash.Play();}function update(){sliderWidth=parseInt(getWidth(slider)-getWidth(thumb));if(!paused&&!dragging)thumb.style.left=parseInt(flash.CurrentFrame()/totalFrames()*sliderWidth)+%22px%22;}function dragMousemove(e){var pageX=e.clientX+document.body.scrollLeft;var pos=bounds(0,pageX-getX(slider)-5,sliderWidth);var frame=bounds(1,Math.ceil(totalFrames()*pos/sliderWidth),totalFrames()-2);thumb.style.left=pos+%22px%22;flash.GotoFrame(frame);}function release(e){removeEvent(document,%22mousemove%22,dragMousemove);removeEvent(document,%22mouseup%22,release);if(!paused)flash.Play();dragging=false;}function drag(e){addEvent(document,%22mousemove%22,dragMousemove);addEvent(document,%22mouseup%22,release);dragging=true;dragMousemove(e);}function bounds(min,val,max){return Math.min(Math.max(min,val),max);}function totalFrames(){if(typeof flash.TotalFrames==%22number%22)return flash.TotalFrames;else if(typeof flash.TotalFrames==%22function%22)return flash.TotalFrames();else return 1;}function getWidth(elem){if(document.defaultView&&document.defaultView.getComputedStyle)return parseFloat(document.defaultView.getComputedStyle(elem,null).getPropertyValue(%22width%22));else return parseFloat(elem.offsetWidth);}function getX(elem){if(!elem)return 0;return(elem.offsetLeft)+getX(elem.offsetParent);}function addEvent(elem,eventName,fun){if(elem.addEventListener)elem.addEventListener(eventName,fun,false);else elem.attachEvent(%22on%22+eventName,fun);}function removeEvent(elem,eventName,fun){if(elem.addEventListener)elem.removeEventListener(eventName,fun,false);else elem.detachEvent(%22on%22+eventName,fun);}}})()
I wonder if this post will make the screen width go all wide and wonky-like.
P.S...yes it did