# Include Horizontal ScrollBar # # Include for SwfTools compiler (swfc) # # # MyScrollbar sprite movie .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" .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 .sprite DragButton .button DragButton_object .show zonemiddleV as=area .show middleV_inactive as=idle .show middleV_active 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 UpdateBar() { _parent.info2_txt = TextField.scroll; Value = TextField.scroll; DragButton._y = ((Value-MinValue)/(MaxValue-MinValue)*(BarHeight-51))+ 17; Reposition(); } function MouseOverText() { if (TextField._ymouse > 0){ if (TextField._ymouse < TextField._height) { if (TextField._xmouse < TextField._width) { if (TextField._xmouse > 0) { UpdateBar(); } } } } } 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; TextField.scroll = Value; } function Revalue() { Value = (((DragButton._y - 17)/(BarHeight-51))*(MaxValue-MinValue)) + MinValue; DragButton._x = 1; Value = int(Value/Increment)*Increment; TextField.scroll = Value; if (dragging == "false") { Reposition(); } } idmouseText = setinterval(MouseOverText, 300); // End MyscrollBar Action .end