X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=swfs%2Frfxview.sc;h=fbda949e7e35b04ad640773db5c6c338057ccb7e;hb=063d536d1cb446bbdf7103ac30ec03b78d0d64f4;hp=1fd50c8ea8facf7f3d47f625397aafd897fb5f0c;hpb=0a6a5f3e53542f43512368ae53e73d939485363c;p=swftools.git diff --git a/swfs/rfxview.sc b/swfs/rfxview.sc index 1fd50c8..fbda949 100644 --- a/swfs/rfxview.sc +++ b/swfs/rfxview.sc @@ -1,3 +1,23 @@ +# rfxview.sc - a document viewer for pdf2swf converted files +# +# Copyright (c) 2008 Matthias Kramm +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following condition: +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + .flash filename=rfxview.swf fps=30 bbox=600x800 version=8 compress background=#CCCCCC export=0 .define width 600 @@ -60,8 +80,8 @@ lineTo 8,-8 .end -.font arialbold filename="../viewer/ArialBold.ttf" glyphs="1:" -.font arial filename="../viewer/Arial.ttf" glyphs="0123456789 /:" +.font arialbold filename="../wx/ArialBold.ttf" glyphs="1:" +.font arial filename="../wx/Arial.ttf" glyphs="0123456789 /:" .textshape oneoneoutline text="1:1" font=arialbold size=14pt @@ -280,14 +300,14 @@ .edittext et width=110 height=20 font=arial size=18pt color=black noselect align=center -.font dbgarial filename="../doc/Courier.ttf" +.font dbgarial filename="../wx/Courier.ttf" #.edittext debugtxt width=width height=20 font=dbgarial size=18pt color=#004000 noselect #.put debugtxt y=20 .put et x=width/2-30 y=8 -#.swf swf filename=paper5.swf -.sprite swf +#.swf viewport filename=paper5.swf +.sprite viewport .end .box f width=100 height=100 line=0 fill=black @@ -295,11 +315,11 @@ .button areabutton .show f as=area .on_press inside: - swf.startDrag(false, left-scrollxrange, top-scrollyrange, left,top); + viewport.startDrag(false, left-scrollxrange, top-scrollyrange, left,top); Dragging = "xy"; .end .on_release: - swf.stopDrag(); + viewport.stopDrag(); Dragging = ""; .end .end @@ -309,12 +329,12 @@ .put f .end .put cliparea=cf x=10 y=40 -.put swf x=10 y=40 +.put viewport x=10 y=40 .action: - swfwidth = swf._width; - swfheight = swf._height; + swfwidth = viewport._width; + swfheight = viewport._height; Dragging = ""; @@ -375,7 +395,7 @@ areabutton._yscale = contentheight; cliparea._xscale = contentwidth; cliparea._yscale = contentheight; - swf.setMask(cliparea); + viewport.setMask(cliparea); lastzoom = 1; @@ -385,8 +405,8 @@ //debugtxt.text = Stage.width+ " x " + Stage.height; setPageNr = function() { - et.text = " "+pagenr+" / "+swf._totalframes; - swf.gotoAndStop(pagenr); + et.text = " "+pagenr+" / "+viewport._totalframes; + viewport.gotoAndStop(pagenr); }; setNoScrollZoomLevel = function() { @@ -409,12 +429,12 @@ swfpos2scrollbars = function() { if(scrollxrange) { - hscrollbar._x = 10 + (left-swf._x)*scrollbarxrange/scrollxrange; + hscrollbar._x = 10 + (left-viewport._x)*scrollbarxrange/scrollxrange; } else { hscrollbar._x = 10; } if(scrollyrange) { - vscrollbar._y = 40 + (top-swf._y)*scrollbaryrange/scrollyrange; + vscrollbar._y = 40 + (top-viewport._y)*scrollbaryrange/scrollyrange; } else { vscrollbar._y = 40; } @@ -449,24 +469,24 @@ scrollbaryrange = 0; } - swf._xscale = zoom*100; - swf._yscale = zoom*100; + viewport._xscale = zoom*100; + viewport._yscale = zoom*100; - focusx = contentwidth/2 - (swf._x-10); - focusy = contentheight/2 - (swf._y-40); + focusx = contentwidth/2 - (viewport._x-10); + focusy = contentheight/2 - (viewport._y-40); - swf._x = left - focusx * zoom / lastzoom + width/2; - swf._y = top - focusy * zoom / lastzoom + height/2; + viewport._x = left - focusx * zoom / lastzoom + width/2; + viewport._y = top - focusy * zoom / lastzoom + height/2; - if(swf._x > left) { - swf._x = left; - } else if(swf._x < left-scrollxrange) { - swf._x = left-scrollxrange; + if(viewport._x > left) { + viewport._x = left; + } else if(viewport._x < left-scrollxrange) { + viewport._x = left-scrollxrange; } - if(swf._y > top) { - swf._y = top; - } else if(swf._y < top-scrollyrange) { - swf._y = top-scrollyrange; + if(viewport._y > top) { + viewport._y = top; + } else if(viewport._y < top-scrollyrange) { + viewport._y = top-scrollyrange; } swfpos2scrollbars(); @@ -510,7 +530,7 @@ } }; r1.onRelease = function(){ - if(pagenr < swf._totalframes) { + if(pagenr < viewport._totalframes) { pagenr = pagenr + 1; setPageNr(); } @@ -534,9 +554,9 @@ }; refreshDrag = function(){ if(Dragging == "h") { - swf._x = left + (10-hscrollbar._x)*scrollxrange/scrollbarxrange; + viewport._x = left + (10-hscrollbar._x)*scrollxrange/scrollbarxrange; } else if(Dragging == "v") { - swf._y = top + (40-vscrollbar._y)*scrollyrange/scrollbaryrange; + viewport._y = top + (40-vscrollbar._y)*scrollyrange/scrollbaryrange; } else if(Dragging == "xy") { swfpos2scrollbars(); }