#
# Sample listbox example for Swftools http://www.quiss.org/swftools/
#
# From the Pipey's Flash 4 example
#
#
.flash bbox=250x350 version=6 name="scrollbar.swf" compress
.font myfont "../font/Vera.ttf"
.box fond width=250 height=350 color=gray fill=white line=2
.box zonearrow width=16 height=16 color=red fill=white
.box arrow_hover width=16 height=16 color=gray fill=gray
.box zonemiddleV width=16 height=16 color=red fill=white line=1
.box zonemiddleH width=16 height=16 color=red fill=white line=1
.edittext info text="####" color=blue font=myfont size=20% width=40 height=20 multiline variable=MyScrollbar.Value
.edittext editzone text="" color=blue font=myfont size=15% width=205 height=300 multiline wordwrap border variable=texte
#
# Get Objects
#
.put fond
.swf up_idle "default/arrow_up_inactive.swf"
.swf up_hover "default/arrow_up_active.swf"
.swf up_press "default/arrow_up_press.swf"
.swf down_idle "default/arrow_down_inactive.swf"
.swf down_hover "default/arrow_down_active.swf"
.swf down_press "default/arrow_down_press.swf"
.swf middleH_active "default/scrollbar_active.swf"
.swf middleH_inactive "default/scrollbar_inactive.swf"
.swf middleV_active "default/scrollbar_active.swf"
.swf middleV_inactive "default/scrollbar_inactive.swf"
.swf BackgroundV "default/backgroundV.swf"
.swf BackgroundH "default/backgroundH.swf"
.swf BackgroundV_gap "default/backgroundV_gap.swf"
.swf BackgroundV_gap2 "default/backgroundV_gap.swf"
.swf BackgroundH_gap "default/backgroundH_gap.swf"
.swf BackgroundH_gap2 "default/backgroundH_gap.swf"
# MyScrollbar sprite movie
.sprite MyScrollbar
.sprite DragButton
.button DragButton_object
.show zonemiddleV as=area
.show middleV_inactive as=idle
.show middleV_inactive as=hover
.show middleV_active as=pressed
.on_press:
DragButton._x = 0;
Dragging = true;
startDrag(this, true, _parent.UpButton._y + 16, 0, _parent.DownButton._y - 17 , 0 );
Dragging = true;
idInt_Drag = setinterval(_parent.Revalue, 20);
.end
.on_release:
Dragging = false;
clearinterval(idInt_Drag);
stopDrag();
_parent.Revalue();
.end
.end
.put DragButton_object 0 0
.end
.button UpButton
.show zonearrow as=area
.show up_idle as=idle
.show up_hover as=hover
.show up_press as=pressed
.on_press:
Up_pressed();
function Up_pressed() {
if (Value > MinValue) {
Value = Value - Increment;
}
if (Value < MinValue) {
Value = MinValue;
}
Reposition();
}
idInt_Up_pressed = setinterval(Up_pressed, 100);
.end
.on_release:
clearinterval(idInt_Up_pressed);
.end
.end
.button DownButton
.show zonearrow as=area
.show down_idle as=idle
.show down_hover as=hover
.show down_press as=pressed
.on_press:
Down_pressed();
function Down_pressed() {
if (Value < MaxValue) {
Value = Value + Increment;
}
if (Value > MaxValue) {
Value = MaxValue;
}
Reposition();
}
idInt_Down_pressed = setinterval(Down_pressed, 100);
.end
.on_release:
clearinterval(idInt_Down_pressed);
.end
.end
.put BackgroundV 0 0
.put BackgroundV_gap 0 0
.put BackgroundV_gap2 0 0
.put UpButton 1 1
.put DownButton 1
.put DragButton 1
.action:
// MyscrollBar Action
function Initialise() {
DownButton._y = BarHeight - 17;
BackgroundV._yscale = (((BarHeight / 16))*100) + 1;
BackgroundV_gap2._y = BarHeight - 1;
Value = MinValue;
Reposition();
}
function Reposition() {
DragButton._y = ((Value-MinValue)/(MaxValue-MinValue)*(BarHeight-51))+ 17;
_root.editzone.scroll = Value +1;
}
function Revalue() {
Value = (((DragButton._y - 17)/(BarHeight-51))*(MaxValue-MinValue)) + MinValue;
DragButton._x = 1;
Value = int(Value/Increment)*Increment;
_root.editzone.scroll = Value +1;
if (dragging == "false") {
Reposition();
}
}
// End MyscrollBar Action
.end
# End MyScrollbar sprite movie
.end
#
# Place Objects
#
#
.put MyScrollbar 220 10
.put editzone 10 10
.put info 220 320
.action:
// Root Action
texte = "SWF Tools is a collection of SWF manipulation and generation utilities written by Rainer Böhme and Matthias Kramm. It is released under the GPL.\n\nIncluded are:\n\n\tPDF2SWF A PDF to SWF Converter. Generates one frame per page. Enables you to have fully formatted text, including tables, formulas etc. inside your Flash Movie. Uses the xpdf PDF parser from Derek B. Noonburg and the tt2pt1 font converter developed by the TTF2PT1 Project and its contributors.\n\n\tSWFCombine A tool for inserting SWFs into Wrapper SWFs. (Templates) E.g. for including the pdf2swf SWFs in some sort of Browsing-SWF.\n\n\tSWFStrings Scans SWFs for text data.\n\n\tSWFDump Prints out various informations about SWFs.\n\n\tJPEG2SWF Takes one or more JPEG pictures and generates a SWF slideshow.\n\n\tPNG2SWF Like JPEG2SWF, only for PNGs. \n\n\tWAV2SWF Converts WAV audio files to SWFs with MP3 Streams, using the L.A.M.E. MP3 encoder.\n\n\tAVI2SWF Converts AVI animation files to SWF. It supports Flash MX H.263 compression. Some examples can be found at examples.html.\nFont2SWF Converts font files (TTF, Type1) to SWF.\nSWFBBox Allows to readjust SWF bounding boxes.\n\n\tSWFC A tool for creating SWF files from simple script files.\n\n\tSWFExtract Allows to extract Movieclips, Sounds, Images etc. from SWF files.\n\n\tRFXSWF Library A fully featured library which can be used for standalone SWF generation. Includes support for Bitmaps, Buttons, Shapes, Text, Fonts, Sound etc. It also has support for ActionScript using the Ming ActionCompiler.\n\nSWFTools has been reported to work on Solaris, Linux, FreeBSD, OpenBSD, HP-UX and MacOS X. ";
// Init parameters for MyScrollbar sprite
MyScrollbar.BarHeight = 300;
MyScrollbar.MinValue = 0;
MyScrollbar.MaxValue = editzone.maxscroll;
MyScrollbar.Increment = 6;
MyScrollbar.Initialise();
.end
.end # End swf movie