аЯрЁБс>ўџ жўџџџБM“QM46BЌ5­ Ю4ЖџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџRoot Entryџџџџџџџџ"pЊ|YЊrЯƒRASHV„qqУc@Contentsџџџџџџџџџџџџ)@9Page 1џџџџџџџџџџџџ­ Symbol 25џџџџ џџџџеел§џџџџџџџџџџџџџџџџџџџџџџџ§џџџџџџџ  !"#$%&'()*+,-./012ўџџџџџџџ§џџџЏ§џџџџџџџџџџџ:;<=>?@A”џџџџЋџџџџF’’IJKLД§џџџ•QRSTZVWXY[m\]^_`ebcТдfghijklœnopqrstuvwxyz{|}~€Root Entryџџџџџџџџ"pЊ|YЊrЯƒRASH0Ъѓ…A]Уc@Contentsџџџџџџџџџџџџ+@9Page 1џџџџџџџџџџџџ­ Symbol 25џџџџ џџџџееџџџџџџџџл§џџџ§џџџ§џџџЏџџџџ§џџџ  !"#$%&'()*+,-./012ўџџџЋџџџџџџџџџџџџ§џџџD:;<=>?@A”ўџџџџџџџBF’’IJKLДџџџџ•QRSTZVWXY[m\]^_`ebcТ8fghijklœnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œўџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџХЦўџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊўџџџўџџџџџџџџџџџџџџџщГ§џџџџџџџHЕGџџџџџџџџНЛџџџџНОПФРСaУ?ХЦЧШЩЪЫЬ+ЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџSymbol 17џџџџџџџџџџџџ%0 Symbol 2џџџџџџџџыCSymbol 22џџџџISymbol 23џџџџџџџџџџџџIџџџџ      !ўџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€…‚ƒЅA†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄІєЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯаўџџџбиезбИм”ншо9прстуѓхцчшщъыьэюя№ёђекѕіїјљњћќ§ўџџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџЦ,џОI #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; function GenericScrollClass() { if (this.bCurved) { this.bResizeable = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 50; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.Init = function () { // Position Items this.userUpArrow_mc._y = this.userBar_mc._y; this.userDownArrow_mc._y = (this.userBar._y + this.userBar_mc._height)- this.userDownArrow_mc._height; // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.userUpArrow_mc._height); // Make sure that the handle depth is greater then the bar depth if (this.userHandle_mc.getDepth() < this.userBar_mc.getDepth()) { this.userBar_mc.swapDepths(this.userHandle_mc); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { fhgeneric_comp.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.userBar_mc._height; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.userBar_mc._height; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - fhgeneric_comp.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - fhgeneric_comp.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.userUpArrow_mc._height); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.userUpArrow_mc._height)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.userUpArrow_mc._height); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { this.SetHandleXPos(this.FindBarEdge(this.GetHandleYPos())); } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = 0; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; YPos += (this.GetHandleHeight())/2; if (YPos <= this.userBar_mc._y) { YPos = this.userBar_mc._y + .01; } while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; } else { debug_trace("NOT FOUND!!!"); } nResult = (leftSide + offset)-(this.userHandle_mc._width)/2 return nResult; } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (fhgeneric_comp.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function() { if (fhgeneric_comp.bHandleDrag) { var yPos = _ymouse - fhgeneric_comp.dragYPos; fhgeneric_comp.SetHandleYPos(yPos); fhgeneric_comp.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled) { this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function() { if (fhgeneric_comp.bArrowPressed) { if (fhgeneric_comp.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(fhgeneric_comp.ArrowInterval); fhgeneric_comp.ArrowInterval = setInterval(fhgeneric_comp.ContinueScroll,75); } fhgeneric_comp.MoveHandle(0,fhgeneric_comp.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; // Set YPosition and height this.userUpArrow_mc._y = yPos; this.userBar_mc._y = yPos + this.userUpArrow_mc._height; this.userBar_mc._height = SCHeight - (this.userUpArrow_mc._height + this.userDownArrow_mc._height); this.userDownArrow_mc._y = (yPos + SCHeight) - this.userDownArrow_mc._height; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.SizeHandle(); } /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { fhgeneric_comp.onMouseWheel(wheelDelta); } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Basic Scroll ActionsџџџџO€џџ€€€€џџџ?џџлkџ›// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџxџM#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.userBar_mc._height; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.userUpArrow_mc._height); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇХЉЊЋЌўџџџЎЖАБВГДЕўџџџЗИЙКЛМНОПРСТУФЯЦЧШЩЪЫЬЭЮўџџџабвгднжзийклмўџџџопрстуфхцчшщъўџџџьэюя№ёђѓєѕіїјљњћќўџџџџџџџџџџџџџџџ‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œўџџџŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУЧџџџџџџџџџџџџШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџSymbol 17џџџџџџџџџџџџ%0 Symbol 2џџџџџџџџыCSymbol 22џџџџISymbol 23џџџџџџџџџџџџI…‚ƒЅA†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄІєЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯаўџџџб5иезбИм”ншо9прстуѓхцчшщъыьэюя№ёђекѕіїјљњћќ§ўџ‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФўџџџЦЧШЩЪЫЬЭЮЯав3Nзџџџџ6џџџџK§џџџклмнопрстуфхцчшщъыьэюя№ёђѓєѕіWјљњћќ§ўџSymbol 47џџџџџџџџџџџџtSymbol 48џџџџџџџџфMedia 1џџџџй‹RSymbol 49'џџџџN@лџџџ?џџи)€€x  џџxdџ€€ џџџ?џџ( €€x  џџx џfdџfџ€€ џџџ?џџЮ €€x  џџxџ€€џџџ?џџ R€€ Layer 1џџџџO€џџ€€€€џџџ?џџѕh€€€ џџџ?џџХEstop(); €€€ џџџ?џџ`9stop(); €€€ џџџ?џџY4stop(); €€€џџџ?џџ=&stop(); €€ ActionsџџџџџOOџ€€€€ џџџ?џџnormal—;€€€ џџџ?џџover'@€€€ џџџ?џџdownŠ€€€ џџџ?џџdisabledY)€€€џџџ?џџv^€€ LabelsџџџџOџOџ€€џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymbol џџџџ€€џџџ?џџ0€€ d…ždd…žџ€€ џџџ?џџs^€€ џџџџ€€ џџџ?џџG€€ d…ždd…žџ€€ џџџ?џџйs€€ 'џ€€џџџ?џџ€€ IconџџџџO€џџ€€€€џџџ?џџ/€€€ џџџ?џџgMstop(); €€€ џџџ?џџhYstop(); €€€ џџџ?џџдJstop(); €€€џџџ?џџї,stop(); €€ ActionsџџџџџOOџ€€€€ џџџ?џџnormalJ?€€€ џџџ?џџoverJ €€€ џџџ?џџdownа^€€€ џџџ?џџdisabledWN€€€Symbol 54џџџџџџџџџџџџф3№Symbol 55(*џџџџSмѓSymbol 56џџџџ+џџџџМsњSymbol 57џџџџџџџџџџџџEЎќ‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇХЉЊЋЌўџџџЎЖАБВГДЕўџџџЗИЙКЛМНОПРСТУФЯЦЧШЩЪЫЬЭЮўџџџабвгднжзийклмўџџџопрстуфхцчшщъўџџџьэюя№ёђѓєѕіїјљњћќўџџџџџџџџџџџџџџџSymbol 50џџџџџџџџџџџџе@лSymbol 51$&џџџџCпмSymbol 52џџџџџџџџџџџџ–3№Symbol 53%)џџџџы3№џџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџš_џЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollџ€€џџџ?џџІ^€€ OffsetџџџџџџOџ€€€  oЭЬЬ џџџџ€€џџџ?џџa€€  oЭЬЬ џџџџ€€bol, џџ, €€€€2џџ€€џџџ?џџE#€€, џџ,џџџџ€€ џџџ?џџ^T€€, џџ,€€€€2џџ€€ џџџ?џџ‚:€€, џџ,&€€€€2џџ€€џџџ?џџŸ5€€, џџ,'џџџџ€€ џџџ?џџ2€€, џџ,џ€€џџџ?џџьO€€ ArrowџџџџO€џџ€€€€џџџ?џџf€€€ џџџ?џџ<stop(); €€€ џџџ?џџП/stop(); €€€ џџџ?џџУCstop(); €€€џџџ?џџstop(); €€ ActionsџџџџџOOџ€€€€ џџџ?џџnormal•V€€€ џџџ?џџoverZR€€€ џџџ?џџdown?<€€€ џџџ?џџdisabledч6€€€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФўџџџЦЧШЩЪЫЬЭЮЯавCNзъ6ўџџџKџџџџклмнопрстуфхцчшщъыьэюя№ёђѓєѕіWјљњћќ§ўџџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџЙ{џЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); thiџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџ"TџЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); thiџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџ$џЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџN!џŠ// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - fhgeneric_comp.userBar_mc._width; } else { for (i=0; i< miniScroll_arџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџrWџс#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { debug_trace("************************************"); debug_trace("Create new Child"); debug_trace("************************************"); var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџџ€// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - fhgeneric_comp.userBar_mc._width; } ray.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - miniScroll_array[i].scrollbar.userBar_mc._width; } } } } return nResult; } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - miniScroll_array[i].userBar_mc._width; } } } } return nResult; } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџIpџїR#initclip var childScrollCount = 0; function ChildScroll(pfnCallback) { this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+childScrollCount,childScrollCount++); } else { this.userBar_mc = bar_mc; } this.scrollID = childScrollCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+childScrollCount,childScrollCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+childScrollCount,childScrollCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+childScrollCount,childScrollCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+childScrollCount,childScrollCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+childScrollCount,childScrollCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+childScrollCount,childScrollCount++); this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relativePћ0И0А0Hўџџџ?џџ%€€ FGџџџџџOOџ€€џџCPicPageџџ CPicLayerџџ CPicFrame€€d…žџе€%€$s&\л€\€лр5мџ€[€$ъ##€&€S0ј§[šЯ€%€Ќџџџ?џџЛI€€ BGџџџџO€џџ€€€€d…žџе42f mсN€сŸ-эџ€M€Y5€ €E0Hў Ез €Кџџџ?џџo€€ FGџџџџџOOџ€€џџCPicPageџџ CPicLayerџџ CPicFrame€€ЬЬЬџџџџџџџѓXџџX0Ј§0Ј§0Xs€tџЅРў0 шў0 џџџ?џџ,/€€ Layer 1џџџџO€џџ€€џџCPicPageџџ CPicLayerџџ CPicFrame€€џѓXp0Ј§0ш0Xџџџ?џџ_v€€ BGџџџџO€џџ€€€€ЬЬЬџs€0p0ј§0ш0џџџ?џџP€€ FGџџџџџOOџ€€Symbol 43џџџџџџџџџџџџЊїмSymbol 44!џџџџO=мSymbol 45џџџџџџџџџџџџPSymbol 46 џџџџ icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.userUpArrow_mc._height); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); џџџ?џџ-4џ2[#initclip var childScrollCount = 1; function ChildScroll(pfnCallback) { this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+childScrollCount,childScrollCount++); this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder"+childScrollCount,childScrollCount++) this.userBar_mc = tabEnabled = false; } else { this.userBar_mc = bar_mc; } this.scrollID = childScrollCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+childScrollCount,childScrollCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+childScrollCount,childScrollCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+childScrollCount,childScrollCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+childScrollCount,childScrollCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+childScrollCount,childScrollCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+childScrollCount,childScrollCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.scrollBorder_mc.clear(); this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (!this.bCurved) { this.scrollBorder_mc.clear(); this.scrollBorder_mc.moveTo(Stage.width-1,this.ScrollYPos); this.scrollBorder_mc.lineStyle(1,0x000000,100); this.scrollBorder_mc.lineTo(Stage.width-1,this.ScrollYPos + this.ScrollHeight); } if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y + this.upArrowHeight)) { this.DisableItem(); this.userDownArrow_mc._visible = false; this.userUpArrow_mc._visible = false; this.userIcon_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userHandle_mc._visible = false; } else if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.userDownArrow_mc._visible = true; this.userUpArrow_mc._visible = true; this.userIcon_mc._visible = true; this.userTop_mc._visible = true; this.userBottom_mc._visible = true; this.userHandle_mc._visible = true; this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled) { this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (s.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџі џџџ?џџB€€  oЭЬЬ 7<Шdџ€€ џџџ?џџ’€€  oЭЬЬ 7<Шdџ€€ џџџ?џџх€€>џŽ// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fџџџ?џџhO€€ LabelsџџџџOџOџ€€џџCPicPageџџ CPicLayerџџ CPicFrame€€џ--џџѓ,œы0*0€С0ае0€>џџџ?џџ x€€€џ--џџѓ,Ь€С0ае0€>00*џџџ?џџа\€€ BGџџџџџOOџ€€џџ CPicSymbolK‘ џџK‘џџџџ€€џџџ?џџ=€ €K‘ џџK‘џ€€џџџ?џџ[g€ €K‘ џџK‘Эџ€€џџџ?џџ˜€€ DownџџџџOџOџ€€ €P( P(џџџџ€€џџџ?џџfhgeneric_comp.ScrollYPosџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџЄ4џЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); thi && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width + 5); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width+5); } } } } return nResult; } function GetScrollbarWidth() { return fhgeneric_comp.userBar_mc._width } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџ"џаY#initclip function ChildScroll(pfnCallback) { this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; } else { this.userBar_mc = bar_mc; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+lev this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.userUpArrow_mc._height); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.userUpArrow_mc._height)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.userUpArrow_mc._height); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var newXPos = this.FindBarEdge(YPos) if (newXPos != -123456) { newXPos -= (this.origHandleWidth/2); this.SetHandleXPos(newXPos); } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var newXPos = this.FindBarEdge(YPos) if (newXPos != -123456) { newXPos -= (this.userHandle_mc._width/2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandthis.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { leYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); elCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enable if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.wids.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџSWџОI #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; function GenericScrollClass() { if (this.bCurved) { this.bResizeable = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 50; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.Init = function () { // Position Items this.userUpArrow_mc._y = this.userBar_mc._y; this.userDownArrow_mc._y = (this.userBar._y + this.userBar_mc._height)- this.userDownArrow_mc._height; // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.userUpArrow_mc._height); // Make sure that the handle depth is greater then the bar depth if (this.userHandle_mc.getDepth() < this.userBar_mc.getDepth()) { this.userBar_mc.swapDepths(this.userHandle_mc); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { fhgeneric_comp.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.userBar_mc._height; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } if (this.bResizeable) { thiџџџ?џџ *€€ dџ€€ џџџ?џџ%€€  џfdџfџ€€ џџџ?џџJD€€ џ€€џџџ?џџs€€ Layer 1џџџџO€џџ€€€€џџџ?џџ1=€€€ џџџ?џџ*stop(); €€€ џџџ?џџXVstop(); €€€ џџџ?џџь:stop(); €€€џџџ?џџ—Jstop(); €€ ActionsџџџџџOOџ€€€€ џџџ?џџnormalе4€€€ џџџ?џџover v€€€ џџџ?џџdown|€€€ џџџ?џџdisabledU€€€џџџ?џж// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - fhgeneric_comp.userBar_mc._width; } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - miniScroll_array[i].scrollbar.userBar_mc._width; } } } } return nResult; } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџ7 џˆ_#initclip function ChildScroll(pfnCallback) { this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder"+levelCount,levelCount++) this.userBar_mc.tabEnabled = false; this.scrollBorder_mc.Owner = this; this.resizeListener = new Object; } else { this.userBar_mc = bar_mc; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Make sure that the Border depth is greater then the bar depth if (this.userBar_mc.getDepth() > this.scrollBorder_mc.getDepth()) { this.userBar_mc.swapDepths(this.scrollBorder_mc); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled) { this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { џџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџq3џs#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { debug_trace("************************************"); debug_trace("Create new Child"); debug_trace("************************************"); var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChs.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.userBar_mc._height; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - fhgeneric_comp.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - fhgeneric_comp.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.userUpArrow_mc._height); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.userUpArrow_mc._height)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.userUpArrow_mc._height); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { this.SetHandleXPos(this.FindBarEdge(this.GetHandleYPos())); } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = 0; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; YPos += (this.GetHandleHeight())/2; if (YPos <= this.userBar_mc._y) { YPos = this.userBar_mc._y + .01; } while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; } else { debug_trace("NOT FOUND!!!"); } nResult = (leftSide + offset)-(this.userHandle_mc._width)/2 return nResult; } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (fhgeneric_comp.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function() { if (fhgeneric_comp.bHandleDrag) { var yPos = _ymouse - fhgeneric_comp.dragYPos; fhgeneric_comp.SetHandleYPos(yPos); fhgeneric_comp.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled) { this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function() { if (fhgeneric_comp.bArrowPressed) { if (fhgeneric_comp.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(fhgeneric_comp.ArrowInterval); fhgeneric_comp.ArrowInterval = setInterval(fhgeneric_comp.ContinueScroll,75); } fhgeneric_comp.MoveHandle(0,fhgeneric_comp.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; // Set YPosition and height this.userUpArrow_mc._y = yPos; this.userBar_mc._y = yPos + this.userUpArrow_mc._height; this.userBar_mc._height = SCHeight - (this.userUpArrow_mc._height + this.userDownArrow_mc._height); this.userDownArrow_mc._y = (yPos + SCHeight) - this.userDownArrow_mc._height; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.SizeHandle(); } /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { fhgeneric_comp.onMouseWheel(wheelDelta); } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Basic Scroll ActionsџџџџO€џџ€€€€џџџ?џџП`џ›// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџg\џM#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.userBar_mc._height; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.userUpArrow_mc._height); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { debug_trace("************************************"); debug_trace("SetScrollbarPosition"); debug_trace("************************************"); this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџ]џl// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { return fhgeneric_comp.FindBarEdge(yPos); } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџHNџЯQ#initclip var childScrollCount = 0; function ChildScroll(pfnCallback) { this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+childScrollCount,childScrollCount++); } else { this.userBar_mc = bar_mc; } this.scrollID = childScrollCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+childScrollCount,childScrollCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+childScrollCount,childScrollCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+childScrollCount,childScrollCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+childScrollCount,childScrollCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+childScrollCount,childScrollCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+childScrollCount,childScrollCount++); this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.userUpArrow_mc._height); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.userUpArrow_mc._height); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.userUpArrow_mc._height)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.userUpArrow_mc._height); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var newXPos = this.FindBarEdge(YPos) if (newXPos != -123456) { newXPos -= (this.userHandle_mc._width/2); this.SetHandleXPos(newXPos); } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var newXPos = this.FindBarEdge(YPos) if (newXPos != -123456) { newXPos -= (this.userHandle_mc._width/2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled) { this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition /* var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; */ // Set YPosition and height this.actualBar = SCHeight - (this.userUpArrow_mc._height + this.userDownArrow_mc._height); this.userUpArrow_mc._y = yPos; if (this.bCurved) { // this.userBar_mc._y = 0; // this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.userUpArrow_mc._height; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.userDownArrow_mc._height; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.userUpArrow_mc._height/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.userDownArrow_mc._height/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.userUpArrow_mc._height); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџxgџЁP #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; function GenericScrollClass() { if (this.bCurved) { this.bResizeable = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userSpace_mc = this._parent.space_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.userUpArrow_mc._height); // Make sure that the handle depth is greater then the bar depth /* if (this.userHandle_mc.getDepth() < this.userBar_mc.getDepth()) { this.userBar_mc.swapDepths(this.userHandle_mc); } */ // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.userUpArrow_mc._height); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.userUpArrow_mc._height)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.userUpArrow_mc._height); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var newXPos = this.FindBarEdge(YPos) if (newXPos != -123456) { newXPos -= (this.userHandle_mc._width/2); this.SetHandleXPos(newXPos); } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var newXPos = this.FindBarEdge(YPos) if (newXPos != -123456) { newXPos -= (this.userHandle_mc._width/2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled) { this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.userUpArrow_mc._height + this.userDownArrow_mc._height); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.userUpArrow_mc._height; this.userBar_mc._height = this.actualBar; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.userDownArrow_mc._y = (yPos + SCHeight) - this.userDownArrow_mc._height; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.userUpArrow_mc._height/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.userDownArrow_mc._height/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; } } this.SizeHandle(); } function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { fhgeneric_comp.onMouseWheel(wheelDelta); } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ pџD#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.userUpArrow_mc._height); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = fun      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKўџџџ†§џџџPБQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€ this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInth-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; tterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.userUpArrow_mc._height + this.userDownArrow_mc._height); this.userUpArrow_mc._y = yPos; if (this.bCurved) { // this.userBar_mc._y = 0; // this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.userUpArrow_mc._height; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.userDownArrow_mc._height; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.userUpArrow_mc._height/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.userDownArrow_mc._height/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.userUpArrow_mc._height); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџ,iџQ #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; function GenericScrollClass() { if (this.bCurved) { this.bResizeable = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userSpace_mc = this._parent.space_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.userUpArrow_mc._height); // Make sure that the handle depth is greater then the bar depth /* if (this.userHandle_mc.getDepth() < this.userBar_mc.getDepth()) { this.userBar_mc.swapDepths(this.userHandle_mc); } */ // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.userUpArrow_mc._height); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.userUpArrow_mc._height)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.userUpArrow_mc._height); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var newXPos = this.FindBarEdge(YPos) if (newXPos != -123456) { newXPos -= (this.origHandleWidth/2); this.SetHandleXPos(newXPos); } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var newXPos = this.FindBarEdge(YPos) if (newXPos != -123456) { newXPos -= (this.userHandle_mc._width/2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled) { this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.userUpArrow_mc._height + this.userDownArrow_mc._height); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.userUpArrow_mc._height; this.userBar_mc._height = this.actualBar; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.userDownArrow_mc._y = (yPos + SCHeight) - this.userDownArrow_mc._height; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.userUpArrow_mc._height/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.userDownArrow_mc._height/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; } } this.SizeHandle(); } function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { fhgeneric_comp.onMouseWheel(wheelDelta); } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ€JџD#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.userUpArrow_mc._height); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ ction() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.scrollBorder_mc._alpha = 0; this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (!this.bCurved) { this.scrollBorder_mc._alpha = 100; } if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y + this.upArrowHeight)) { this.DisableItem(); this.userDownArrow_mc._visible = false; this.userUpArrow_mc._visible = false; this.userIcon_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userHandle_mc._visible = false; } else if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.userDownArrow_mc._visible = true; this.userUpArrow_mc._visible = true; this.userIcon_mc._visible = true; this.userTop_mc._visible = true; this.userBottom_mc._visible = true; this.userHandle_mc._visible = true; this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(d = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // dis); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/tance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(thBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџй‚ƒ„…ўџџџ‡ˆ‰Š‹ŒŽћ‘˜3§џџџкЈ—™žš›œŸЂ ЁЄЃЅІЇХЉгЋЌ­ЎЏАцВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхўџџџчшщъыьэюя№ёђѓєѕіїјљњrќ§ўџџџџ?џџ}€€ Layer 3џџџџOџOџ€€€€ Layer 3џџџџOџOџџџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicShape€€.џџџ.џџџѓџq€ииш0ш0ќ0ќ€€џџџ?џџ1"€€ Layer 1џџџџO€џџs.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџUџЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollis.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOvBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџЩTџf // Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function SetResizeVisible(bVisible) { if (!fhgeneric_comp.bVertical) { fhgeneric_comp.bResizeVisible = bVisible; } } function DoHideCursorOnResize(bHideCursorOnResize) { fhgeneric_comp.bHideCursorOnResize = bHideCursorOnResize; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width); } } } if (!fhgeneric_comp.bVertical) { nResult -=5; } } return nResult; } function GetScrollbarWidth() { return fhgeneric_comp.userBar_mc._width } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } function ShowMainScroll() { fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; fhgeneric_comp.user = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOerBar_mc._visible = true; fhgeneric_comp.userSpace_mc._visible = true; fhgeneric_comp.userUpArrow_mc._visible = true; fhgeneric_comp.userDownArrow_mc._visible = true; fhgeneric_comp.userHandle_mc._visible = true; fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџТ_џZ#initclip function ChildScroll(pfnCallback) { this.bVertical = fhgeneric_comp.bVertical; this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; } else { this.userBar_mc = bar_mc; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bout(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); ttom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; t }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handlehis.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = fhgeneric_comp.topOverlap; this.bottomOverlap = fhgeneric_comp.bottomOverlap; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncremeBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџrWџŽ// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџžџЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџ#jџж// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - fhgeneric_comp.userBar_mc._width; } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - miniScroll_array[i].scrollbar.userBar_mc._width; } } } } return nResult; } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџіFџˆ_#initclip function ChildScroll(pfnCallback) { this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.scrollBorder_mc = createEmhis.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџ™rџ`Z #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; function GenericScrollClass() { if (this.bCurved) { this.bResizeable = false; } else { this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",0) } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userSpace_mc = this._parent.space_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Make sure that the handle depth is greater then the bar depth /* if (this.userHandle_mc.getDepth() < this.userBar_mc.getDepth()) { this.userBar_mc.swapDepths(this.userHandle_mc); } */ // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.scrollBorder_mc.clear(); this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (!this.bCurved) { this.scrollBorder_mc.clear(); this.scrollBorder_mc.moveTo(Stage.width-1,this.ScrollYPos); this.scrollBorder_mc.lineStyle(1,0x000000,100); this.scrollBorder_mc.lineTo(Stage.width-1,this.ScrollYPos + this.ScrollHeight); } if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y + this.upArrowHeight)) { this.DisableItem(); this.userDownArrow_mc._visible = false; this.userUpArrow_mc._visible = false; this.userIcon_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userHandle_mc._visible = false; } else if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.userDownArrow_mc._visible = true; this.userUpArrow_mc._visible = true; this.userIcon_mc._visible = true; this.userTop_mc._visible = true; this.userBottom_mc._visible = true; this.userHandle_mc._visible = true; this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled) { this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { fhgeneric_comp.onMouseWheel(wheelDelta); } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџчZџ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ ptyMovieClip("ScrollBorder"+levelCount,levelCount++) this.userBar_mc.tabEnabled = false; this.scrollBorder_mc.Owner = this; this.resizeListener = new Object; } else { this.userBar_mc = bar_mc; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Make sure that the Border depth is greater then the bar depth if (this.userBar_mc.getDepth() > this.scrollBorder_mc.getDepth()) { this.userBar_mc.swapDepths(this.scrollBorder_mc); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.scrollBorder_mc._alpha = 0; this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (!this.bCurved) { this.scrollBorder_mc._alpha = 100; } if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y + this.upArrowHeight)) { this.DisableItem(); this.userDownArrow_mc._visible = false; this.userUpArrow_mc._visible = false; this.userIcon_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userHandle_mc._visible = false; } else if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.userDownArrow_mc._visible = true; this.userUpArrow_mc._visible = true; this.userIcon_mc._visible = true; this.userTop_mc._visible = true; this.userBottom_mc._visible = true; this.userHandle_mc._visible = true; this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { s the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpAr yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } else { this.scrollBorder_mc.clear(); this.scrollBorder_mc.moveTo(Stage.width-1,this.ScrollYPos); this.scrollBorder_mc.lineStyle(2,0x999999,100); this.scrollBorder_mc.lineTo(Stage.width-1,this.ScrollYPos + this.ScrollHeight); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.scrollBorder_mc._visible = bVisible; this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.BeginResize = function() { _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; Mouse.addListener(this.Owner.resizeListener); }; ChildScroll.prototype.EndResize = function() { Mouse.removeListener(this.Owner.resizeListener); _parent.EndResize(_xmouse,_ymouse); }; ChildScroll.prototype.Drag = function() { _parent.Drag(_xmouse,_ymouse); }; #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџ iџЕj #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; function GenericScrollClass() { this.resizeListener = new Object; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBgColor = 0xffffff; this.nResizeWidth = 4; this.CreateResizeBar(); this.bResizeable = false; } else { this._parent.space_mc._visible = false; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount) this.scrollBorder_mc.Owner = this; this.scrollBorder_mc._alpha = 0; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth this.SetResizeBarDepth(); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.scrollBorder_mc._alpha = 0; this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (!this.bCurved) { this.scrollBorder_mc._alpha = 100; } if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y + this.upArrowHeight)) { this.DisableItem(); this.userDownArrow_mc._visible = false; this.userUpArrow_mc._visible = false; this.userIcon_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userHandle_mc._visible = false; } else if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.userDownArrow_mc._visible = true; this.userUpArrow_mc._visible = true; this.userIcon_mc._visible = true; this.userTop_mc._visible = true; this.userBottom_mc._visible = true; this.userHandle_mc._visible = true; this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } else { this.scrollBorder_mc.clear(); this.scrollBorder_mc.moveTo(Stage.width-1,this.ScrollYPos); this.scrollBorder_mc.lineStyle(2,0x999999,100); this.scrollBorder_mc.lineTo(Stage.width-1,this.ScrollYPos + this.ScrollHeight); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; } this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; Mouse.addListener(this.Owner.resizeListener); }; GenericScrollClass.prototype.EndResize = function() { Mouse.removeListener(this.Owner.resizeListener); _parent.EndResize(_xmouse,_ymouse); }; GenericScrollClass.prototype.Drag = function() { _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { fhgeneric_comp.onMouseWheel(wheelDelta); } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџAџ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ R      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPўџџџ§џџџSTUVWXYZ[\]^_`abcdefghijklmnopqїstuvwxyz{|}~€rowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.GetHandleYPos() < (this.userUpArrow_mc._y + this.upArrowHeight)) { this.DisableItem(); this.userDownArrow_mc._visible = false; this.userUpArrow_mc._visible = false; this.userIcon_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userHandle_mc._visible = false; } else if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.userDownArrow_mc._visible = true; this.userUpArrow_mc._visible = true; this.userIcon_mc._visible = true; this.userTop_mc._visible = true; this.userBottom_mc._visible = true; this.userHandle_mc._visible = true; this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - t = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } else { this.scrollBorder_mc.clear(); this.scrollBorder_mc.moveTo(Stage.width-1,this.ScrollYPos); this.scrollBorder_mc.lineStyle(2,0x999999,100); this.scrollBorder_mc.lineTo(Stage.width-1,this.ScrollYPos + this.ScrollHeight); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.scrollBorder_mc._visible = bVisible; this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.BeginResize = function() { _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; Mouse.addListener(this.Owner.resizeListener); }; ChildScroll.prototype.EndResize = function() { Mouse.removeListener(this.Owner.resizeListener); _parent.EndResize(_xmouse,_ymouse); }; ChildScroll.prototype.Drag = function() { _parent.Drag(_xmouse,_ymouse); }; #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџD џЕj #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; function GenericScrollClass() { this.resizeListener = new Object; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBgColor = 0xffffff; this.nResizeWidth = 4; this.CreateResizeBar(); this.bResizeable = false; } else { this._parent.space_mc._visible = false; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount) this.scrollBorder_mc.Owner = this; this.scrollBorder_mc._alpha = 0; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth this.SetResizeBarDepth(); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.scrollBorder_mc._alpha = 0; this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (!this.bCurved) { this.scrollBorder_mc._alpha = 100; } if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y + this.upArrowHeight)) { this.DisableItem(); this.userDownArrow_mc._visible = false; this.userUpArrow_mc._visible = false; this.userIcon_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userHandle_mc._visible = false; } else if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.userDownArrow_mc._visible = true; this.userUpArrow_mc._visible = true; this.userIcon_mc._visible = true; this.userTop_mc._visible = true; this.userBottom_mc._visible = true; this.userHandle_mc._visible = true; this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } else { this.scrollBorder_mc.clear(); this.scrollBorder_mc.moveTo(Stage.width-1,this.ScrollYPos); this.scrollBorder_mc.lineStyle(2,0x999999,100); this.scrollBorder_mc.lineTo(Stage.width-1,this.ScrollYPos + this.ScrollHeight); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; } this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; Mouse.addListener(this.Owner.resizeListener); }; GenericScrollClass.prototype.EndResize = function() { Mouse.removeListener(this.Owner.resizeListener); _parent.EndResize(_xmouse,_ymouse); }; GenericScrollClass.prototype.Drag = function() { _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { fhgeneric_comp.onMouseWheel(wheelDelta); } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ9Aџ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ nt=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHe*      !"#$%&'()ўџџџ+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRuTUVWXYZўџџџ\]^_`abўџџџdefgўџџџijklmnoўџџџqrstўџџџvwxyz{ўџџџ}~€ight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (hgeneric_comp.SetBgColor(newColor); } function SetResizeVisible(bVisible) { fhgeneric_comp.bResizeVisible = bVisible; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { nResult -=5; if (yPos>fhgeneric_comp.ScrollYPosSymbol 47џџџџџџџџџџџџtSymbol 48џџџџџџџџфMedia 1џџџџй‹RSymbol 49'џџџџN@лџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџZџЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); thiSymbol 58џџџџџџџџџџџџЗJўџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width + 5); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width+5); } } } } return nResult; } function GetScrollbarWidth() { return fhgeneric_comp.userBar_mc.‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБўџџџГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдўжзий№лмнопрстуфхцч4вdџџџџьэюяєёђѓ7ѕіїјљњћќ§Aџ8lpxэ}wXзк§Сc4НЧ4M3՘511іо;VT,((в{o" вAь{зи[zЙп=…о-iїћ§љ[kЯlŽIЂЙз8<Яћь™9‡sЮ^kЭšwП{Я9ƒўЇ# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #а8i}џƒоyЇЋCП~##mmчэtw ;ИњRhPЪЅDP " й*’А__X?OпПЛ?ƒI}Xѓ˜еk+rюШ!Й$Їф–“ыЦЉB–ŽРЭ<мКu›‘яМл}Хд) OzЙЏИМЦф—eєёЬ0К/K5.sK1.uM2:Л$—,]m\тТH4.^ВкшT‰иО9ј=nѕaЌSИ жфFpЎШЙ#‡ф’œ‚[rLЎЩ9ЙЇnV†~DGрfž{шЁЧœ sие5цJH`ЖбkY†qЩтdуќ‰Ц™ГVЇL7Nœgck9)к8|bŒqиFДq(c|ДqBiЃФіА Qx\‰ЁhѕИ§H|йџ!уё.Ш 9"WфŒм‘CrINЩ-9&зрœмSд5qГRє#:CЛ–­ZЯљДїауюqЦ@Ÿ5F—%)ЦЙі‰FлЉ+ЃЦ-7cь58ви}`„ё§ўЁЦЮ}‚ђћŽ-žК0НТ5(Ї:2aџѕД 'оКыв/Л|§лс“џњэи™џБŠџ§эшiMœСіŸ эkќщэџСgЙЁщЯŸ§,ўц§Žaпя#ЇўѕыўcпўВcџW7жm;{meњ‘JпЈЅѓ–­+9=СдmP˜р’œ’[rLЎЩ9ЙЇ j‚к FєsEG€4AєшаЁг6'Їchа:уR—tуœй‰ЦqтŒ Ѓад;НCЏї 4ОќЁўC#Ъьнж]_ЕцјЏy‡Оўїёѓ?ўПs_™џwц гџўмјЇ.^љП“З>G'/рєИ%ZЬ‹399ѓЙёџ§вєџЮe&GП8ёУЯыЖ_Јій]4мnЕщOƒЧфšœ“{j€Z &  j„ZЁfєП{Іƒ}яОУП Ю0њxg8Є'иЎ2іkьк7ТјzЏ`у‹ŸюъSаuxL•kиŽ_6эњќпO§ыпћOќыЗ}ЧПџmїбoлuфЛпvўіЗМCпќ–wј›пv ­ ЭОxœЯ9єЭЏл}­Ч_Ч@С\СД^ЬЩ9QАWИкuфлпі§юпћ>ћ\ўЖїиї7жž,Д(ЫдсуС9ЙЇЈj‚к€FЈj†кЙwЯœ{ЗчЬ9C&лЮ3FGlF}, улdуа1+=D_џ8ФиО{€ё‰Ў>І'Лљ–vШќ)iУщ_s|ѕыцН_ќВ.яв/k;/§’wQ ЙЭVnѓ1Й_лfэЈ{œћzќ1 $Ў7Й_лjy‘|ШVyŒќ‘Ы Л>џuЫО/нВїЫkЋ|0*–м P дЕAP+а ЕЃ[ю-џxДѕ§m“чЯї0F…oFšeœ6#йиФ уЛ}ЂŒ/}b|ВЋПщсw}ЭрWaчОщчд-gNнzіЇФ ЇD$ ]%тфOм–!—­<ЎЗЕ§нXH.иjп{冓 ‡ы•у||ѕЦг?gцœП—uЂdрЬг#]|ЉЁ jƒЁVЈh‡Ђ–ю­ГчоьmЛ­ZЇ,\ш…kЦVувЅYFлщЩЦ>#Wпюajп-ФєhSЛЮ>цЛј”OXœ}#&ѓјЈєЃзCS]M>t=,эа№д#""аFЄН‘†@™qLmБЯэ ЅхqFT^ ЏЇ<І‹LG+ЃцyъcbџИј_љїF[лч(бo‰[ЏХИ[‰{С†ЩЙSy$ЇзУSЫ чзУ’b›@-˜ƒ&  jDh…šЁv !j‰šК7ЯІ{Ѓз- 6MCЇMw0ЦХц—-[kœj—fь;|•щЭОQІі=BLНчojгйлtп;ХLXqЭgхОk>ёћЎzХэЙъЗћšчђ=з<уі\ѓРЖзŠ=ˆНъsдvе~ь#”№M8pMDтСkО‰Ўљ%Мц—x№КoBУч\з†ђмјŸ{)ъb@<~31Б%ЦОФZХ]ђ 8мЯНзМфЮ’Wх‚лЋhзрћšяЊ§WнЂwt.4!МVЈЁjZЂІЈ­{у,КЗzЩ:жмƒFW'ф}|7gЭЫ4 ЗкдЙ_Ќщ…aІЧК˜штkКЏГЛљсМ+ІК­Џ^‘WН(l;"ЗzQhnЕ#Ж‹сy"œ#ѓЊЃvVЛ0ЂwU/о}е5ГэžЋnV!уу8.З—b›ЁлЋЖЪўR<ЗОџ{ЗЗѕѕЧ,ъbR‹“ŠБŠЁ|Оkёџф f79м8Gэ\-g‚ПАh>Щ-9^ˆ@[Е0$Їк%bgйH‡Lѓя{ mP#д 5эPCBKаЕЅзJџYž"цZ_~хЭoWЏкj нjZр”m>%едup<ъчЈ}šкЁІбњИП‹gA‡AЁ•vо›*gћlBЛБr[ŸЭ•Г|7WЮілZ5Чkе\џmUssЊццTЮ ЪЉZВНЪAEayеŽсЛЊ"v"vU/ŽDЈ-їEˆc;qЯ‰T‚л‹Б­ О†#Ž9тљJШ§ПвЪзК]э_љ,ђk?‹‚Юm-ж8‰}K`JМk1&юxн№]UрЂЪ!t‡рUЮ _ wsЖ‘KpКEpk'јV8яUГ}7WLїиџ|пЁ j„ZЁfЈjZЂІЈ­а˜>GћЯёŽ‡[оз&зЧ7жЛ<ЯфтОб4iVІщуб‰ІзњФšžыjzИ[€Љ]7s›М^EЧЦVL^ЖО|мв5х\ГЫ'Й­­˜ьЖЁbŠЧ†ŠЉž+ІСSІ{oЉœсГЕвЮokХLп-h+чРCьƒ•˜œ[97x{е|x cAШŽЊд/bДМ л" kj;lg•C8Zm№x8пƒ!њnpX/тЈ`)0%ЎРXХ›иWЮ(|€›ŠYўлW3сџ3|З’Cr)8тОЏ'з‚ѓёр~МKvХ$зѕEoŽ6ЗщъM˜VžCЮё:ДC QKдДEQkџœ3чоэI3Ўбш?xŒ)9yЗЩ/p›iЖУZг`лTS—С+M/ѕBЎёQљ‘~ц{јšлugјН=6Іlє’ЌВŽ™e#ВЪF;Џ)ыВІlмвlhj}љdїѕхS<6–OѕмT1КЃoЬєSТ.p[…]Рж ;hQ9+ Їr6ќdЎsаnеœРэUєЦМрjфЁE„0 }Ёnѓys­#ЧіЗ ќŸНѕџr_§џПмZН6пKФ->WЭћZ§ПР$ˆ^[‹1и# nG{x=›k`.ёWИ‚№4ƒ9„Яfr'8œьБžœ–_š]6<^ВІlфb…ћaŽeЃœ2Ё‡хцvаЧCаЧЃ=s|,ДC QKдЕQkдмН{Ц§3zў|Л‡Ÿ8“eŠŠЭ3-YЖЩ4оЙ֘$гkbMэ? 3?й+ФќXЯѓ#=§Э#§иЏ№‘‘ЅƒЄ—]˜^:Ь1НlјbњGfй(ч,xЧšВ‰nйe—­+›фБЁlВ7ќƒсГЉ|4)єщ и*"ЖƒrБЯМЄоРЙ aЁЯмђмЙлкњњТcЂJПТE`fOьЌ№$ЦozЧLјЙ№лBnЪЇњТ+М7‘3pЗТ/мж–ЇЃ]Вр™eУœ2K‡-Ъ(тV:h~ZщрљЉoŒˆ2?ђ1Есo~ьуѓSНBLЯ} Х@KЋ…ІЈ-hŒZЃцўgЯНй дИ›,1zŠ))yЩ7$Ч4лiƒi№”tг{#W™; ˆ2Зяf~ъг`xG љЩOН-Oї ЪyHxIП9ЩЅЄ–0†,J+ъ˜Q2bqVщH—ьвБак87е7Мр xЧ4пM3˜w@Ћvhga 3+`›2~сКžKп@оСкШМ \ѓбŠЦО6дЧХѓдуџ QЂЮsЕџw—lЫ~А­щK=}цcтЙ*N7`H,џ ‡`[ŒGЖ ьЩЙ'Т3O^Ыl=сюЪ&ИЏ/уКЖtЄsv Ў %C2зфМџќд’~іЉ%}ц$ta~Њ7ќтгЁ“ЇЁ™чњ…QCаrhŠкЂЦ 5jŽкЛ7ЯКЛЗз’АЇ[З}јhDT†)fХN“‹я6гЄykЭŸNH5П5<^јЦѓ§CЭЯє 6?г/ШђЬ€ ЫsˆчY^Vд}кЪтўѓ“‹8Є– Z”^2и)Гd˜ГъЎйЅ—­љ4X>Eњ†ЯЦђОе14jmЈЙБю6‡о€1 ъpГY‹ @mЕ9{lГ6‡:]5jЋе№•jh_iе§šуAЙuŽ‹чЪџљЧДJkћ\'V3bG<‰Ѕ‚щЖJД жРиKШ ђAХлЇР3&{Ў'wЅ–­- пэпp^#8Д0МЇїї}ц&vŸoyaPАаЦ3‚ЭЯі 2?г'иLэ№кC-ASд–аДFЭQ{<ƒЄяоГщојфф‰бЬ`c3ОлG§Œ)iћLсyІљЎ›ЬЃь2Э=Ц&›_gю0$ЪќТРpЫ B-/ ГМ0$4џЅЁсљ‡GцП6:кђц„˜ТžГVї™—VмпОс˜Y2о1jIVщh\ŸЦ.Э.‡Б sнIюыЪm1NFЭЃbŠъl^›*ЇaўeКЯжоЊPƒЋš‰yъЇ"fљчT!ЊgћчVЯi fрБ{4DпТХ?—и‰xJ|еzЇЈ[Oѓо .'Ђ–a‹qх$їѕe–­+чЖVpHЯэЌp;xQfqПщфМш“9I…=g'М5>6ПуАpjNЈ•Ёц"ЈЅc“Ј-jŒZЃцЈ=jPъёо8ћюЮ^JŽиЖ64iž0oЁ—).aЩ=pЛy†гzѓРщцїСё#–›;‹ЖМ4$ЪђђK‡aˆ‘цWFEš;‰ЖМ5!ЮђюЄ8Ы{SVц0-!џCЛФ‚^Г“ ћи'і›—R4Р!Нx№Ђєт!Žщ%Ј•ŒpЬ(…zыЇc\ВЫЧ.][1оu}Хз ]7VNZЖЉb’лЦЪЩЫЖ(сОЅвжсОЅЪж}k•­ЧжЊ)žj`Šv_9^9Хs‹6ЊІтјTМЦЭ >їяˆF}~vіAл'nзт ё ФDн'VРŒи 'ЃUqk`.Арb9!7фЈdЦ"рŒм‘УЂi…Ш/Ш-9з љLOАМgoщ<9ŽZ &ЬЏŽŽВtiщ0лЬ“ж™{OM7w“hykTœхеБ–Ž#Ђ-ЏŒˆЪutŒљѕБ1ц7ЧЧšп™ДТќод•–nаЮ‡vЋѓ?–њBS§Є`ЬR8Ш1НhЈSzбpЇŒтK2q­BюšЧxWЬп-лP>qцѓwиbЎeŠ'Ю!œгМлЊfxчTЭ№aф"ЩЉЖѓЭ­ЖѓAАEЬђCы—‹М$Їzї­ЯХА>ўчіЋь|sd4і5хѓй6іn§М†ћ%А& 6шЇ3bЈт‰ж;‡ Ќ9БЏАѕиD.Ш Й!GфŠœ\’U4|qЙ,Д(м’уќ>s“ѓ‘kX>œ™ $šпŸКвмšxs42&šZЁf,‡ГЕМ92ŽšкЂЦЈ5hŽкЃЕšќчŸw_ЕќpЭяшЮ]?НМrѕГ_xžyОћѓ˜yйц^Sв,яб7FЧ[^—џњшхˆXs'ЬГН=qЙЙЫфxЫћгЬнgЎЖ|<;ЩвъKПX˜V0xQZ!ъf…#gtЮ*Ц5ЌdЬвЕ%у]з•NtлP>йcЦ*Ь‹ЗbMРVЌэШЉœ ]Яєп^eЇЦ,џэwф!vVЯ дїеАи…cЇrПІE]dgџgњ­єЗІ7ї˜H|цpЛvФ3c–Zœ9Б'ф‚œrDЎJ&ИЎƒЌ-ўсМІз€Т!‹г 9Т?ІцїuH%їд€а5бХ6оќжDцqљЏ1FЧZ^Чѕ‡ZzoЬjjKhŒZƒцЈ=jZдjѓю;ГўЙŸXђТuОŒћК9Э›АЯь’gžƒкЦ0ћ5–ІЄ[оŸАкђіИ•љo"оŸџЮј–w&Ч›п›ВЪ„ы‹щУYЋMŸи'›њЮO6ї_˜bш˜ž?Ф)#ј’ŒЬУТ/ŠрХунж—L\ЖБtВћfдчЗ”AŸхг}sQ‹лŽyПэXcДk ђPыuЛ1ЧИЛz^ˆѓCїTЯн­ЦžъЁ{k#loЕw`Ћж‹эЙ9ТЌŽqџїЂОзИЧ~яНыћЌ7ПЗьЏвƒш 6иЎ‹[ žФ–KМ+gх‘С8)Ÿю“KŽЪ0*ьБЙdЂћFrX„qLсчьфљУ–d€ыtpžFюM}ц%›>ž“lBоiњ`Мcъ*KчIB3љoOˆЯk\<Д” 4mQcBkдДG R‹R—RЇџм3ёющ™ф‚мpН Ѓ­ЁiЋшёг›Утї˜— ЖсВб2dnЖЅчєtKЗ)IљяNJЬяŒxwrBў{SРћŒDsїYIІžs’Нц&ћс;Z,J5 v‚–d˜G8gXFЛЌЩчВЖ`ДFЭMім\ŒыXЩTŸmЅг}sЪS”Я ЬЋ˜ИГbN№.ЌUм]9/dж4юХЙ\ УїV;FьЧш§UŽ‘ћЊaл)т@M,Цvн8ˆ§ƒU‹#ї#T-ŽВ ЛЃо~ьg_еЈ‹ƒ#bFьˆ!БЌZОЏЦРœи“rANШ 9"WЅг|З‘Лb[ЯЭфœЎЫGўaэœeО‡.Ю їFфЦОаТЇsSЈ jФђўЬDj&џ]лEC“0ž™ВZh Ѓж„ц =jZ”КЄFЅ^яž3ьŸїI%в3šƒц…šЕо>п5в€кЦџ\ЫT—M–СѓВ-Ньвѓ?œž‚Zgr~зщ)нfЄфwŸ™lљhVŠЙзМcя)Цў гЎ vLП‚Мѕ r гЈЅYц1Ўй–ёажDїM“<7Nёо\4е{[ё4пœЛ€эЅГ‚ђЪ ЯђЙ!{Ъч‡ьЉ€OTBЫ•‹ш Њœ"2ЊGЊZuїXЊvFИФ0WЛФЎТvŽ#W-eФдDѕви#5ћЎ1GЊъ‰JќЯm WМN}q›^ПОЯ.ŽЉ§­гWq X ёŠ^Ф лC`FL‰­Š31'іф€\rSfМ‹\‘3rs mН6€з|фŽј‡yЬвlpžyз‹+Ш=Ў ž…ыHЕAX>š-4Sаm&tD-MOЮџpZЊЅзЬtЁ1hšЃіЈAj‘šЄ6щКwќч}ˆОaэфш1Cѓ6g\RЭž‘y'ПэлЅ›,CцЏЭя='3ПЇ]Zў‡3вђ{ЬN+ш9'-џ“Йi–оѓгM}ЁŠ_\Ж8уђHчЬ+Ѓ—Ў1Ž]Жж4о}ƒы„ђ'{o.˜тЛЕpš_NбЬ€мbЛ Ѕдтм]eШЅЫЉS\ +#їW.Ž:XЙ$њ ќš‡/№мw[~”QН,юXЕћŠclЋдЈvЧіŠуUюŒ8ЅѕРЖЖ=ерЖv_G[щЙќXЅgмy,?VгЭg}віKєг `Ѓ`Є`VCз*зиЃk`NьЩЙ 'ф†‘+rFюШaсtПrš?йkГkHMу—­чйфўђчLjзфŸiІО …Vђ?ž эиCGГ3гђ{" -jLh šЃіЈAj‘šЌЯ;ўѓgаНї ъЫ5Z‚ŸVЊ™ж!Г пТЌќўŽYІA‹3Џ uЩК<1ЪuЭejgœЧК+<6'ym4лњlБLѕлV0=`{!4WlК БЛtAиОR\лЪE(ЇNЁY—иЃ•аpЅЮe7шм=ч;Тs%bеguТkе‰*яU'k#сdЅзЪ•оЋDTљ`_нЎєС15*|VžЈ7|qМQŽчмŽhЬ{‰ч4№yeD[_ŸE•w‚`EЬЌq$ЖФXs=9ф„мЃв…сћЩЙ#‡…Г‚ЖLgNъЗ•ƒыMфќЪXuд€аТpj#г4hIf~?Ї,jFh‡њФ>ƒšк‚ЦЈ5Ё9hЄЉIjSЯ9ўѓ>U_ЎСчЬŸ5Д|шk—рlЫ’а\‹ƒNОэВ­љ#жчY˜Й6§bбšТўNйƒœГѓ‡,]kюКж8 :V~DŽqyМчњЫН6\™фНб„ы‘yšџVЫŒРм|Лр…а[бќА=ХИ†•:F,]}ЈŒк\Кќh…ыŠcЫт?Ћє`@ѓ^єшчПЇЊ|O+Бњt•Ж§ gаžЉє_}КN`?pѕщ џФS"NЃQpЊ‘qЯ;]ШHQ†зК!_OМ6пC‰F}.йЕ=Х>ВЏ•ьГФFХHСЬиI}N l…Пg`NьЩЙ 'ф†•:E"gфŽк‡э*˜МУ2# —›l§Ж\™ьНщђЏѕаР:Ё…1nйд†y˜лZj…šк† њ9dASkЈ-Ё1hšЃіЈAj‘šЄ6ѕœу?ыжЙљ Ї“Ÿ6†І-ŸЃo8ЌБ8чZцУ7ІylЫуВ1ФтuƒЏ-И8ЛpѓКТЁЎы G`ќ1ЪsНyŒћњ+у<з]яЕўЧ о~œрГёђdпWІјm6NиfžДн2+$Џ`nиюТ{‹Ђі;F,Y -КФ)[КтxљВ•ŸUИуzяЙъdЕыxКв‡оtЖв/ КO:ЧЈ @p;0љ|e ЖеЈL:[ФH>[\7ЪƒVŸŒVВ еЇЫ‚g№М:QœxК&‚А§GBѓПжЏЋюпњsсГЫ~ˆVэŸuПФиHœи ьT,kp%ЦФ˜{r И'ф†•:Ч)]{Ии1ц 9,œБЗР>l7Й%ЧЦiлŒSќЗ\žьГёЧ‰>ыяНўђ8/hУЕїѕдJсpѕB;аЕDMQ[Bcа5GэQƒд"5ImRЃдЊ^чјћ§Ѓ>Я`ЈzF‹v†fїЕ7Дzјы…~йЇэљs§sѓЇ{nЫŸрЖЙ`єв УрУ\7ŽpлX8вkcбŸMу}6[&њl6N„WLђнјП№‹ЫЖў[ЎLѕпvez`Žz2Э ЫГЬиUА r_сЂшE‹cCЅ.+Ž•-[yМЬ}е‰rЯ„Sд+Ў…№ zХйЪ€dш=љ\UPЪљЪ јD0к`Жˆ” ŒŠ”ѓЁj„Ѕž/M9‡`ЋDіEЄž+ M9[_”†%Ÿ) K9ЫЖ1Q–tК&BБ§GBѓПy/эgЋяГѓXyXЊкGЋО‹ `RƒА’ИерHL­РX ЬUќЩ9!7фˆ\‘Гт%Ы-Ž9D. Ђі‘[гЌаSzЎ"зЧ јD0|"DxХХЪАŒ‹•с+jуREDцЅŠШкРЙrЉ<*у"Ѓ,2ѓB|CDTЦ…RxХM…cQЖщчKЂвЮЉэTЋHуу"ŠёМ†#е џ|]Ѕ­ї}Хч’ŸГц3згЇ2єЕІпР@тAlДX ьТqLХ“и ŒCбs`Oр„м#rEЮШ]БыЪc…ЗSЫЂи§цб{Mѓ"w]™‘wй.lЛаРдр­—дFСєэдJё”h'Їh"цж %jŠкƒжЈ9jЄЉIjг*чЈ3/ћїAїо;е7FЁЫ\ƒsхOZД}\­ш=Ц)п!х`нfжbЮ-ЗажwЎр=0ЗxjpnёєаэХ3Уѓ gFюАиEюИb– ПШљб.|ћex†q^є.г‚˜=fxFОcмЁчј#EМVЙ'/ё\}Вд'щT™4щŸzЖ< э\y`кљ њѕ– ŸШМXБЦЪ#ВpdС#25Ёь—с˜Y—J#3/–Fн%№•†Ђ8*§‚ˆhДˆ"xЩŸ‰ЦМЖxŽњyњМ<^_йїВЈ, ‰S]ЬˆЁЊїТ‡жФи“rAN7рˆ\‘3rGЩ%8=œяwШМpљ~pНзˆыФћШдЕpAm"ŠgFфO нAэPCд’аДEQkдЕG R‹д$ЕisшuŽПЧУЄooЮi1з`šu'њљЃ№uЮ{НhИяQпЎ§gфЯо^А tWСœр…Xw\83о[4ќЂxzиŽbЛЈ%ГЃ1'ГЛ`NЬ.гœ˜МЫГЃрQ;/Яоue~ЬnЃCь>ГcмСќ%+,]uДhєц‘јY‰WвЉRПфгe~Ÿ#Ч€>QЋHПTš~Љ2ZfPЫ‘k>WЎ•ЊЮЃз|^ŽsB Б]s$СVн.E[Љ†ВѓьRMрБтшŒ‹JЄЃеD Же(‚ќ!пWДкЯ$Ж•Я[‚Я^гєIщgнўZуA\ĘqЛXj§C`Э<и Р9!7фЈЬ5 pFюŠ=O€ЫЯШiОѓЪ#ЇЫї‘sr/40;j5Q`‹yїхЛ…VfFюЄv !ф\‚ Ж 1jšЃіЈAj‘šЄ6еœЃ%5KэЪyYЉыПч,КїоХjŒR3‡B—ЙчН^6쿘эsz_БїлZ€{@ ц…ю.До]8;dgЁ]№іЂ™И^и…чЯŽоU2;vw‰§ŠНХѓтїЬлmžЛ|зeћш—эcv]žЛыŠCмуЂИ§цХё‡,.Ћ,K8ZфБњxБwвЩп”SЅўЉgЪ‘gcL‚ы[(sgњ=y†№ j•ЅјEєšKхЕёЙє qžа;Ѕ"ръvILцХ:› _ШИ€sСVїe(ХЄŸWуZDšкrћЏFзяSћ™фчЈя3f\(Aъє }”§-QњЎХDњАћ\ƒŸ№b[kbOШ8!7хС+rFюШ!Й$Ї—„Уц%ё‡LŽ+і_qXОмУ;b ƒшдDСМ{Јj…šЁvЈ!jЉШ.d‡а4F­Qsд5H-R“кœЃЁЙ•{яŒОѓ=–žЬZ}šѕP5зРJгV№ѓ6єuŽ'_1Д~Ђk‹‡_>?qqjС\фœЇsѕсЛŠf‹иYlоэсsуі–Ь_ЙПФ!ё@б‚„}–љё{ѓуv_žЗыђ‚Л уїWю79Џ:˜яšxЄ`йъЃ…^IЧ‹}“O•јІž. H;[„š^j˜aаЇsSГu<у‹ŠЈь/pmќB\/ЅgРЪcж\*‹…WЈQ{оР;pЌцМт9‹kЕШ!иŠmGЄ_lŒFЇ/Œi0.рБп‹њџЏй˜їV>{/‘§}гњћЎХBтУ–˜•;‰Ѓ’w(GЎљЂЦ?ШA8ž NШ 9\ІŸ+ёK=MЩeћъЃфжьМъб|ƒspПчђќЛЈj‚к(qH8 ДЭP;дєД“š*ДG@cд5GэQƒд"5ЉцmЈUж9Ды9єњшѓmЎ!Ч(єэ0FaНњqCѓž1Д|yсы†ћŸzл№РГЉ=GЛЬСјsєXsяˆиS4/bјоS<7vOЩ<\;ЌмWК0с`™Sђ‘ЧЄУ…‹šVюЛтПчЪBxˆуЊ§ЦХЋі›YшIЧ Н’OљЄœ,СuЋзЏВр е70Чѕ­œyr„Иў}Q‰ЙќB ^+ГnЮ1xžp\‚ѓЁ-ќ1 Bёщuл"фѕE!rŒ†ЃAпЈпіѕљ ПW}ŸЧ~ЏOВпb#Мјдф 8F,ЫЃ4јk`яј‚ СIъFє pEЮШ9$—ф”м’crMЮЩ=УМpе~j‚к FЈj†кЁ†Ј%jŠкR5Ж—šЃіЈAj‘šЄ6ЉQj•š•sВrЌ"НуЮAїц+k}CЮН{ŽQXЏ~ЕЇч ­ъ`h§ј›†6Яt1Д}оОУ{У-г}ЖЮ Ї‘ИfDэ+BГx~ьотq{JФуВъ@ЉcвЁВХ)GJХKRP#[}кйwХqео+N ћŒЮ LЎ‰‡ЭnИ.y&+єN9Yф›zЊи?эLIPњйвјFhцEЁЯphљБтдГŒlцж"jtЯs@уЅИŽ20іљЛ2іШФ9ЦPќЂ(>!CѕŒТhœЗЗˆ‚шдsJЄЁeШ§Пкж}Н[}>^у%Вheџ”ОŠў^ЙАИˆќЃџИ–GуМu\ј99"WфŒм‘CrIN-Ш#MK›\’sroDK-PЅKRŽ@+д ЕC QKE1{Ј-jŒZЃцЈ=jZЄ&ЉMj”ZЅfѕБЪпуcв7ДcЮЃЈcQ•c”w <їЁн‹=›?њъ‰ѓW‰кжk-ˆн_Œy‘т…qћŠЎиWВp%<#‘Йж‰Ї)sN;Zъ’qЌШ%ѕˆХ9њIмwyq"|9ˆыъ#fїЄЃhЌР'ѕdЁ|# ОqЎz, …„б3cl]Ћ_UЫЃ”С7jЃьћ&ћЉД˜35xсФŠ˜Џ:љ‡тЩвЇ5ўA.Р Й!GфЊ$8§Й+ђO;M.ЩЉмš\“ŽWМВ$9fт~j€Z &Ј Ё‘ХЩXЇŽќкЁ†-ХюЇЖрћЈ5jŽкЃЉEЋБЪ§д,Е[пXхя9›юwЉЯ78NdšїЪ1Ъk†ћŸ|заЖ}Уƒ>2<ибяѕЇЮєлQ8OјЦтEЫ;Ц(q\‰м3с`Љr ^K\вŽ–Лf|Vю–uВд-ыDбвєcfч”CW\’і#˜м’Žš=’ZМ’јТ7ќгNІŸ. Ю€od]( ЫКX†ыКQНb ЎЬ‘ˆmскыЇ˜Wрм‚—`~DѕЖŠOа+2/мtЊухFЮciчђЃгрˆ˜zуŽk"л эџˆэ›__}ппћl5c(ЋdZ–|Dё”уљ~Љ' PW+ Ь8[”qЖуцвph’кD[†ueИЮ)Оm^Хѕ2[‡d]d CЉeа3”ыЊіГьlыжWыц 'zGM(Ипвј§ƒXs,CЯ&рBЫ Й"gфŽ‚Ы“яХ7РБрœКС3 jAh‚ўP+д ЕC QKдЕEQkдЕG R‹д$ЕIRЋzуЮњ…|u­oАЖ!зˆЪљWŽЙžЗЃZлшЪ1ŠсЁŽ§ tъoxД“WЧ'Э№л^47|_ё"ЌwЇgЌ: ў•qывДc"зX–uВТcнЉJЏ gЪН6`ŽосžyЬф–vФфž‚|#х˜Х;ѕИХ'ѕГПДгап™"Ž•C1fЦ:ЃЌ7оМИš-EоQ §*ы0шЌ]Я@§^}kЦѕkъбч БІSžKкЖцм‹I=Ѓ&“+4Ю+’с'ѕХ­}І1ŸAћ™ХЖZgбіБf“ѓХW•:R;вƒя 3ˆ9Б'ф~NnШЙ"gфŽцћІž ЇфVpМ,§(9/ёZ‹{6œІЈ‰Šek”œZa­ƒкЁ†Ј%jŠкЂЦЈ5jŽкЃЉEж8ЈMj”Z•kРdm”šжЎ“КзлП†€ЕoД24kD9N”5QYлx q\љ‰сЁW€Л†ЧоиьёЗї ˜‰яiйY<9Ч r~Єд9 ѕŒдЃe“”Лeт^жlм?ЙўTЅїЦ3ˆГх>NC?žYŸ™нгрЉЇЄ}–я›v"9n!rнЂрЬГE!ч„w„g^(‰@‰qKдš‹ЅШ›KАў“Z.С\a їQчЋ­[d`,Т:ЇRї”c§šѓFфщчES‡Ÿh(Їhœ/дžџцЈф3%ўшћеы+єZџ5[eLV›[I\ˆБтОCb*АЦ жФœоБц"Йœ€срŠœ‘Лд7Ш%9%Зф˜\“sr_щГёl‚š 6Јj…š)uN>J aœr˜šЂЖЈ1jšЃіЈAj‘š”5Y•5jYїПц §ЗЦ7ъмЧІжDХК Ўч}еањIжЁКкНм œ 4<њц(У]Цžxoк#Џєў|џlБ]0цQ–У7V‚ћ$мW|ЌЬ5їРgžЈ№Ш>UщЙї`oР§и›ЯUњm>[юЗёL‰ЯZднГ Џєуoј†OкIњFA@кщТ xGђо0xGxцyЁб(hыУkƒžСЕЕ5NQПPЯžuЯx…ЈgЪ|"э|эX ЖО Œ7ъsмк’Ю˜Ђ’Nџ•0G%нвwъї~f9О‘§с8GдqkrЈккЊєэ\Lн1 Б%ЦТŸыb/|ƒм‡!зWфŒм п—ф”м’cr Юq/ѓцГд}Ѓвk§ijƒЁVЪ\’Ё›ЄудЕDMQ[дЕFЭQ{д ЕHMR›дЈv‡і>7ф5їЙ5tшЧџв7ф\ яIiЃЮЅАЮєДКЖќ5е7PzЙЗссз}k”сё.“ Oukxђ}ПM)œъ•S2+s)ќ†DњЦё2ЗДхЪЅТ›љ†те›ЯWњoЦ=QЯ•њ­У|жЉŸє“~щЇ ќгOQu}#у|qЦ,ИЦЁ…w`L‚(ŽB‚qIm§BЮЉтк‰9ШBм›VШБ‰Јrm…є4њ‡ˆК5Ь†kuќ"љDaŠN>};ЂЁзЧ5љLCўaн/й_Е='ъЇjо%0VЪИEЩбjѓј1&жwr pqО8џo—О!Мƒ<2|2N’[rLЎЩ9ЙзhšЈ№dн+ы$ЕBЭP;дЕDMQ[дЕFЭQ{д ЕHп 6YЅVЉY^ѓЈскћcmtпјcЖpЫgKпр9ВNДIKb_w.Ѕѕ“С‘єСрn4ќŸ\ЮАyІч›'пOyoЈsЩŸ%Г#і—.\ЙЕеŸ•ЙЅ ў•‰1 ЦБоы”|УгYjчjрж UˆŠ€ИЗa§ЙbПьгEў™Ї 2рєSJО‘yЎ(Џ+ж~^К"БіЃ$юц(ŽЫОЈФДuЃ(.ыBCQИ<ы|aм МvCяЫужŸSйWњQ_eџ‰E0Љƒ0“ј ,‰)qV0V0W9\€С 9"WрŒм‘CrINЩ­р\“srO P дЕAP+eГТP;лzŒїЃ–Ј)jk†ЭГ2пЈЧ7И†Cї[žьЗё ѕјытољк|уО:љrФз‘+"пxМЫDuœТk‚8^dѓBПЭкœеeИ[Щ$Џэev!{Ыч-?Rю”xЂТ-ѕtЅGій*яѕчЊ§6œ9GъaЙ_мˆШљђzDю—з#sПК•ѓеЕЈœ/ЏХ –ч~umyЮззтЖ}sm".чыыё9п^пЦјюкЊœoE$lc‹}KШљюъЊ­п^ХБЋ‰9J‹эъ„­пдU [ОЖŽЪ„Э_е‰8^OT$lњђND}я%Ž5№љЌћС§њњЬc-FРŒи ‰Ѕ‚ЉР—X+˜op p>Ш 9"WрŒм СЅрмђњp\“srO P дЕAP+д ЕC QKд”Ь7Ј5jŽкЃыцЪ}*ЕљFŽSєљ”лшк—’Обp]ДЅјЮ ц‚ЌAiъв7>˜fxњCr;пІ}'›ћ/БyiрЌ&э?‰щјщœG9Џ+›ДЋм>ъPХТј.ЉЇ*=ВрkЯC?ЎlМp-p rŽm_мЇwьјъFдіЏoDяјњF ZЦђпмˆлёэˆјэˆпўД*яЛ иOиёнOЋѓОgмX§е;ОЛ‘Шиўн$Дˆы8v}ѕv%’Жw лзVч~ЋЮеЙмЧЏтИ№n'еъе9пдIл”уIxœлЗ%дї’Џ]Я{[О:Ÿ]єQєUэŸшЋкoр,jp!n*^;bШcРД_`MЬір@pANШ 9’|‘;rH.С)Й%ЧWЯИ@юЉjš 6Јj…šЁvЈ!j‰šЂЖЈ1јЦпЈЇ.кRЏ‹jOю;И-}ƒsU ЪяјjxіС—?5<$цSFw‚сIсГmžћ„;кМ |УЭІУаEM^ъяёxчБЧњЬŒ+ŸьНЋbfшўŠyбG+%œЈZšzІк3ыќU_x‡џЦKз7q=DxЧW?ElџцЇHш3 Г§лŸbЫБ—їнЯ+ђ~јiМbeоw?%Р/jbчї?%b?'b{ѕЮяo$Т[„‡§гW№—Єšѓ…ч}%ЏN\УљRлБ}ыИšД§›kIxžмGР{ўPмєyoх9ЕŸйК?uМОI р"qfФN`(А$ЦиЏСћФ.Р‰р†‘+rFюР!<у+rJnЩ1Й&чфž Ј jƒЁVЈj‡ОA-QSд}ƒZЃц8ŸB vWчSєyи;h Мєяљз}=ehYѓНoк<лЭаю%Й~c8oxВыTp n{ЭГiп›Йхb›.mђђрeM: ukкqЈcЋŽƒ_щЛш›!S|їTЮ 9P5/њX•уЊе.)gЎzdœПцГітuhыFрц/ лњеOслО§92їлŸЃ1;п§МО—ї=єњ§Яё;?ќМ2O‰UЛ~јyіWэќзЯ Œ]lј9qчаНт%мfЌоЅёс/№Дj\ЧЙЃќЅf[ƒЧрЋ/ЎёИЕџр76ъћџњоЋі˜ќ\В­§ЬВ?Ђ…Їо€ŸвK…/‰}VХJ`І`ї/ЅРиJœ‰9Б'ф‚œrDЎРЙ#‡ф’œ’лЋючЋ—Іœ!чфž Ј jƒЁVЈj‡Ђ–Ј)j‹ЃжЈ9Й~ƒZЄ&хК/j•šх5O_ПбР ›k|CЬУrѕ=єкuцякО№БсЁWИжw˜сБwЦžшjkxК‡ЭГЯЕyЎ7ЧЃШ/8лМ4Ш poвq˜WгWGК6}eшВ:Ь|s№вЏ‡:dTB3U3ƒTлG­vˆ§ьъ’•ЇЎЙ&ŸНюž~ў†WЦХŸќВПј)`§—?nјъ—_§КљЋ_ТЖ|ѓK"rЫЗПFm§юзшmп§Гэћ_—#bsмЮ§сз88—ѓУЏ+ЖЫјўзЙьЧoџс—Йп!Оџћšјў—јэѕЧJџј9~ћwJфЊ­f%ާ^Фзѓ?ъы§о{ŠЧњМ+№yыє}Э§Ž}W0X(xbGЬTќˆ%1%ЖФhis.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџ‘Yџћn #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; function GenericScrollClass() { this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.GetHandleYPos() < (this.userUpArrow_mc._y + this.upArrowHeight)) { this.DisableItem(); this.userDownArrow_mc._visible = false; this.userUpArrow_mc._visible = false; this.userIcon_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userHandle_mc._visible = false; } else if (handleHeight > scrollRegion) { handleHeight = scrollRegion; this.DisableItem(); } else if (!this.enabled) { this.userDownArrow_mc._visible = true; this.userUpArrow_mc._visible = true; this.userIcon_mc._visible = true; this.userTop_mc._visible = true; this.userBottom_mc._visible = true; this.userHandle_mc._visible = true; this.EnableItem(); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; Mouse.addListener(this.Owner.resizeListener); }; GenericScrollClass.prototype.EndResize = function() { Mouse.removeListener(this.Owner.resizeListener); if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); }; GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { fhgeneric_comp.onMouseWheel(wheelDelta); } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ@џ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ oџ] // Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { f      !"#$%&'()*+,-./012ўџџџ5§џџџг789:;<=>?@ABCDEFGHIJdLOдhPQRSTUVeXYZ[\]^_`abўџџџйfkg|ij„lmnopqrstuvwxyz{€}~hgeneric_comp.SetBgColor(newColor); } function ShowResizeCursor(bShow) { fhgeneric_comp.bShowResizeCursor = bShow; } function SetResizeVisible(bVisible) { if (!fhgeneric_comp.bVertical) { fhgeneric_comp.bResizeVisible = bVisible; } } function DoHideCursorOnResize(bHideCursorOnResize) { fhgeneric_comp.bHideCursorOnResize = bHideCursorOnResize; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_cos.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџЛ"џŽ// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function SetResizeVisible(bVisible) { fhgeneric_comp.bResizeVisible = bVisible; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { nResult -=5; if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width + 5); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width+5); } } } } return nResult; } function GetScrollbarWidth() { return fhgeneric_comp.userBar_mc._width } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџАbџŒX#initclip function ChildScroll(pfnCallback) { this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; } else { this.userBar_mc = bar_mc; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } _width } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџџŒX#initclip function ChildScroll(pfnCallback) { this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; } else { this.userBar_mc = bar_mc; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+lev  oЭЬЬ 'џ€€џџџ?џџШ_€€€џџџ?џџМ*€€ ThumbџџџџO€џџ€€€€џџџ?џџxs€€this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; elCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut˜Xs`Oф„м€#rEЮШ9$—ф”м^uˆ=AЎЩ9Йџ~A-Pд5B­P3д5D-QSд5F­Qsд5H-ZЏ3Џ{/Н^пИM6qгЫh}ƒ5y ПџD§~Рšћк:iюkыkxфЁ˜уОЩ†ЇКO7<ѓ‘НЭsbN…œ3Яфuƒ:№hђЪpЏІЏŒєnњк(fЏtППгЈUЏє[t чд(ќVшЦŠщў{ЎЮ 9xmnфсkбЧЏ;ХКБdхщŸ\Юўф–xюgїфѓПxІ^ќХ+ѕтЏОi—~ѕKџтЗ€Œ/ѓЯњтЗРЌ/ \ѓеПƒж|§яЦZФКЏџКю›‡fѓя0ДaыОVZn#Т7|ѓяЦFЦЗjЋlGbПОˆТsoxMэsЂё?$ДџeѕZuг|–њ>+YїKєЏЩО LT,jАQ1#vФP` L-1Xs`OШ9!7фˆ\‘3rGЩ%9%Зф˜\“srO P дЕAP+дŒZл ЬЅ<ї)ЕEQkдЕ'яkЃ&ЕїЕQГњwїмtšпіє щжО!Пы‹псјю9фї+ЉkП:pнœSбд8zЭ7ДяНацyŽUИЈОБ зІЏŽР5e„OГзGћ6{cŒoѓNcМZtхзін Ћ_ъЗ(Зы„Р#}этОЕxMСЏм2;џнхГіVиэЏœrАjAиЁъ…с‡Ћ#Ž\uŠ>zuIЬБkЮБЧŸ]_wтКkќЩыЫV тOоp?uУ}хЉ"NЃ=}УсЕ ‘pњ†7к:Сc‰ЇoјАЕ oDрwoмЩhЬgрsnњќjпФqЋ~ bBlˆ‘ vРX L‰-0&жФœи“rANШ 9Њ˜ДŸœ‘;rH.Щ)Й%Чфšœ“{j€Z &Ј j„ОAЭP;дЕФ1ŠЌmXеD;P‹д$ЕI6є_ђћОЈs§яі! ѕк5ЃЕпПё4ЦЕїЈДСїіД}Q­qМ5м№Xчqw2œixІч\БŽЃ=Ц*/Xх‡{6}оёкHщ~Э;ѕoўцИ€ohёіxџ–яŒїoеy|Р}]&Ж~oRPыї'ппе6фўІ„нп}jx›юг"јpzфЮŒjћбЬшv=gХДћxVlЛ^Гcь5gљƒŸŠXё`яЙ+ъ#"ўсОѓтъSš§•ї/F ,Ф1ьKмˆЁФ“иcbMЬ‰=9 ф„м#rEЮШ9$—ф”м’crMЮk=уЕ‘д„G“ŽVЙЦ Ш5кcŒвўSjJЃ<й•ZCmу-j|ЧаІцоjДvЖўяН}gŒўJD@њ†\k^;ЇвЌцžXЕЦёЧ“ќооЧмOЋМ#з1Ÿ”ѓБ2чpЖyQд9DЮ}pыньЕQŠwtC4k|`ЫЗ'Е|gbpЋw'…Дъ29єОїlУю{JxыЎS#юџ`Zф§нЇGнпcFt›эbјШ.іžГ–?№ёьИЖЯ‰kћЩœэzйЧЗћtюЪvНч‰xАЯМUі™_}ч'<дwС­ЃžѓOŠ[їyеƒ}58ѕ™ПиI‰)Б%ЦФš˜{r@.Ш Й!GфŠœ‘;rH.Щ)Й%ЧŠgty5@-а3dЎA­дфъќ+5ЅЎ/я‚1Ъ;дЕG ЊЕ'ф=єJMД™uMдFцњй~{ЈЯ7dmTћVcопі:kлœc­{ŠІ>ЪБЉRчPцV˜ƒВюЅŽWЌМуЭБМY{Е'Му>xGkzG7щ3cк(о!ќЃэ'№ъКWФЗы=—!ѕ/Ю…›МDы+Vлс\К›ЃŽgZѕMѓ˜ФEт$qЋѕ‹^Т——cb-<иУ3f*žбm:Й GфŠœнфржЏљ›Ш3Ќ<уY Uъ/rЭ†ЈkШz(5EmQcдšfНW1Šў[ЗзѓjЊoИ†Cж8”ћлъŒUфX…s^œћъЊЬЋШœCдGy]рѕѓэœ?cЮa]#uoњŠъЈ‰еЩ;рšМ#ЈeчšмzДЅ.ЉЯкмЃ;s™2їўkсђЖЬAш!J"ѓžЕч„•ЇШхi­qPАQђŠкмт“9ФRцТ/”~бН&Чаx†&Чш<БnžaэЏфѕƒZАЎ…R3ъмы'2зѕPц˜GСїѕД}AЮПR“ЃˆћйДпЈљэ%о +rъЦœ њs}ЃОœC§nbёЛАєs~o4kзќnЖwq?Оџр%ЎПсu@ЎхрXtЦЄЪxхљ>Еу•—ЩљїІ‡[ч>Эо-Ч,JюёЦ-ЕоQ3niШ?p МйC>0QЦ2ЬGДСsЄўјДу =џПёxУ}аb lЋc`EМЌН‚Й’_дыVу’Ю—М3AдЌдБ ЙхИДfl"<ЃЖІСyзкёЩѓb}(5D-iзl(kНкНDэе~?`+ёЛKъКћЌжmдŒQЈo§яі# ѕ ™spЌ"CEоЋЂЭ98ŽљА}1^ЂоЏТЙЎбa=‹ѓВr )t1њЈѕцЏŒ№D”zRr7FГжЮœV;niœ іqџ‡3EЂzˆжGb@§T­‰№МЈ yЎ№к*B=wjŽпэћV§ві]­UHldNAмЄWSm C“_мф59†—€Kz†ф—\“smžЁzFЭкPj†кЁ†Ј%ЮЁP[дЕFЭis yяМўНЂЗпѓŠв7XC’ѕQŽU”œЃЖ>ЊЩ9ФœЌ\?Ъяnуšц”ЏpюЬЮ№ьЧЪšŽіт~7ŒYФtz‡k“—‡,kкqsO\М0—яеьuјцiUя№oёж8F@‹wPћшб9ХћЖ Х+КР+0Gя&ф‚œrDЎШ™7ИЃ_x‚KrJnЩ1Й&чф^ЎэЂ&˜“R#дŠє jHЎ)ЇЖЈ19‡BэЉu 1їjkh}CŸќ5OhЬc}ƒcЙ–C­sШп—ыG1З"ю­—5RЮёЛTxЯП;–МsŸШ;АNXzЧBш„ї+‰qK“—1nщ0ФzтН nЈ“Й7}u8ƒšљGѓ7FQ‡ТCЈMХCЦљЕ|{œXPу!ЬEо|_а9ДNНCї­Лژ‚э:жkCюЁАюПК/№‘x;‰Ѓє щФœиУ+Ц‘ †є №„мBё Щ#9%Зф˜\;ƒsrO P в3И–œZЁfЯxLмПFM)п]ЎŒOx_6Е'ї€ѓ}ђ~™kPЛдАдscДЏ?чЯ# qжŒUjжуw˜Фwr№7Іхo#t0мї8sFо_Яя–ц=\<ky­ЋцЋRЌ•r~Z‘s-‹›М4p ‚з с!Њ,ƒоУн›Н:œы‘НЈIс!F{Зш4кЇЎm-оуЫkuЌњHЭкБVШEМ‹ін їu™(#овp`Нйя>ў{џћпіияїEтС–)Ёр&зlеј№%жФœи“яцFK^Ф§рŠœ‘;њ…+И$Ї"ПЧфšљ&ЙЇЈj‚к F86ЁfЈjˆZЂІфoГQkдœ\ЏA-Ъяіb-Žљ1ЎuТ3фј„šжџю<в;Д9‡\ЦпT‘kЯхx…П]Ск6Чтћщ…wШМƒ:˜hxВчсё]o1ЅV8зЦ5JўётЇ&/ X‚kЎGƒK›v‚Ъ{ž\›сžИfЏЃ‡И7}„GѓзGz4ёњHOx‰'ж.c§2ќфЭбо-Ёi„OKh\ФлhпыKнЫhѕЮ8п:Ч4ћ~šmэёЛiћц>дэЃш‹Ф-1RBСMтHL‰-1&жZьЩ9!7фˆ\‘3r'y$ЇфжQјыЯї%їдЕ@MPдˆтJžAЯ –45ЇЉ59>‘kЪЉIэŠžkмyhшш2чs+r=ыOœѓТМЌјz9ПТћ‹8?&НCŽYИ6x4jтœO›lxК˘kСwОIџр5‡ZrhђBПEM^ьЯ€ЮxmДИщЫ—4…—4э0˜свДуЅа'УUj­[Гз†3–AЧ2м›П1BD‹7FК#љ>чц…и<ѓсtфЊд“Эs+вОП‹v.t'Ђ єзф…>ѓЁEЦ‚&/і]аєЅ~ 56}ЉџТІ/ї_и њm-7ы0РБYG„lЙнqря…SѓWжFGlпЭQл—пыГњXЌˆ1$–S`+q–И“ЩЙ™ Ž$_фnŽMћ^ф’œ’[r<\“srO P дЕAP+д ЕУqo'C‘g№ЗQЄgPsдžМWžšЄ6хјDж5nЅo§ё;ƒ€uЮA^ШsBŽ'e­CжIЕyыМW‘ktИІ”9'Џ#œ‡че?ФoНё^Zс!6OwЗЕyКЧ›ЇUyЖч ›чzЮ„юv6э?aЬbрћ'Г›<п‹1Їщ ŸжіM_ь­ЙM_ьЃЧЭh1тv}Xђ˜Ф[тO.$/’'rЦяЇOKr:мЊ^б•k2˜_Pд5!Ч%д 5CэPCЬaЕyЕЦњšЌiXЯŸHЯаs;у }U™sШёŠЖжбwАоСњППнЩ\“9'Ў#ЙvGњЧБМПqИсqц ]ј{:ќM.ХGžњ`ЂЭSн&й<нšЃіlmžЇˆјэ‡S›<ћ‘ŒiMžћШ*zbП&І7mпѓцxЧтБg4}ОžhcwcммєѓcЅЏuњ-ћ/Z-fъv\%оlЩ‚щфŒмMРw“KrJnЏxМ39'їв/Ј jCŽKЈjGж@5yЦMža]гОбX}ыЯЛ3hsщВжЁЭ;˜7ЊЕвЖЌ[сwЈцz>~_,kœЇхš~gѓPцМЏ‘5sшчMъˆПЅƒ1ngњчсFтЗYј;ЃmžxoДЭ“я1ˆxЌЭSяГyЊы8›'loŽёMžў`Мšэ MžюІЧЭд‡1Ќ[-іфМ0GфŠœ‘;rH.Щ)ЙUНтMrNюЉjš 6Јj…šЁvЈ!Ек–кЂЦДy†:чZSгžЁчwЦ ўшЋJяЙ‡Џ7щkJярќп—ыб9.эˆљvЎеQќЃъэ^фя)p=єѓъЇXиЧ№ШыМп‘ум№Ц УcoQoœЫgPCmЇ6лУmžшмPŒАyђнšh‚m6OдчsфёjЋХ}зіSѓXC8ђИ‚Л‚Йф€œH~Ш9“ќ‘KrJnЩ1Й&чфžљ…тm„_P#д 5CэPCд’є jŒ9.5'=ƒZдњ…юєьОѓЯ—ОAžЌНCжJЙnыїИuo^/ИF‡плМѓ щ\cЪК—’ƒ(ђ!Ў=дзљ№ZдЫ№А№ъыŒyЂўŠО6ОбзцлњЃŸЭЃjу1Э6[яkŸ{Зo[ї­ю~Cxi1mw'7фˆ\1Ш9$—ф”мjН‚мSМ–(~бњ j„ZЁfЈjHЎ•5ањAЎЕ^СБЌЈ~!ђ jGЎчвфњифя=ЭяШЛIя`Ћё:5S+џhЉŒ_šЕтм‹ЌP;ЌёКƒ\Е-uХ ЦЄЇаWЬiѕјяУ@ђУVђ&y$Їф–“kщдsQjBцв/n•cPsњпн€Е(у–кќCЛ4aў!жЈsЬЪ„z‘ущ#Я0ЄО˜—Ш юjRПƒzy<Б•ќI>y>AЮUЏh!ыд_TыЭ‘УЪq‰VcwїйЂzk$ЗкмCёe}:5ЁxHэFжQЅдz ы"uт>ъNџ^ 8їaХ™ЈUSkŸ якмBыдŒє jIъЪZoњў?ЩБlЩЛдЖў!зœђ#Ч2дѕ$ƒз"m0—•Й ЗѕјЏР@p$Йбђ%y”!}B›WPšњE_H§ШіŸs†4Ў'џ|5!џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicShape€€ џџ@ 6 6 7љџџўџџџџ@ 6 6 §џџўџџїлџуиЇиљЯўsџ4ЙЙrџЊў4ŽЌў4X@ЈП1sџд €џ€€џ4dVŽ4GGŽV4crџT4ЙGЊўŽ і€э€џѓ<ќФ€€џџџ?џџœ,€€ Layer 1џџџџO€џџ€€зBAЧЮ1€ˆ1јЙˆЯ­ else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; tes = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); tPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandl this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.S }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); }eXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetH return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; andleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height +etHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = y ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџIpџBo #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; function GenericScrollClass() { this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; / this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.us/ Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; Mouse.addListener(this.Owner.resizeListener); }; GenericScrollClass.prototype.EndResize = function() { Mouse.removeListener(this.Owner.resizeListener); if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); }; GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ,iџ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ ‚ƒ„…†‡ˆ‰Š‹Œўџџџ‘’“”•–Т˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСўџџџУФХЦЧШЩЪЈЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўўџџџSymbol 26џџџџџџџџџџџџ|I Symbol 18џџџџџџџџ—Р Symbol 8џџџџџџџџџџџџ0 Symbol 20 џџџџJі mp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScrol€ џџџ?џџ+;stop(); €€€ џџџ?џџJbstop(); €€€ џџџ?џџwstop(); €€€џџџ?џџУPstop(); €€ ActionsџџџџџOOџ€€€€џџџ?џџ€€€џџџ?џџnormalYW€€€ џџџ?џџover |€€€ўџџџ ўџџџўџџџўџџџўџџџ !"#$ўџџџ&'()*+,-./0123456789:;<=>?@ABCDEFGHIўџџџKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqўџџџstuvwxyz{|}~€ џџџ?џџdown@€€€ џџџ?џџdisabledjZ€€€џџџ?џџ "€€ LabelsџџџџOџOџ€€€€€€џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSyml_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width); } } } if (!fhgeneric_comp.bVertical) { nResult -=5; } } return nResult; } function GetScrollbarWidth() { var nWidth = 0; if (!fhgeneric_comp.bCurved) { nWidth = fhgeneric_comp.userBar_mc._width; } else { nWidth = fhgeneric_comp.userBar_mc._width + (fhgeneric_comp.downArrowWidth/2); } return nWidth; } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroџџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSpriteЏ) ЎRЎRЏ)dџ0Ў|€€џџџ?џџГT€€ Layer 2џџџџџOOџ€€џџCPicPageџџ CPicLayerџџ CPicFrame€€џџџџё€ЬВ&0ў(0В§€€ џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymbolЯџџџ я|џџƒЯџџџdџ.€€џџџ?џџЮ€€ Layer 2џџџџџOOџ€€€€ Layer 2џџџџџOOџ€џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymSymbol 24џџџџЏŠSymbol 21џџџџџџџџџџџџpSymbol 13џџџџhеSymbol 7џџџџ џџџџc?ll_array.length;i++) { miniScroll_array[i].Show(false); } } function ShowMainScroll() { fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; fhgeneric_comp.userBar_mc._visible = true; fhgeneric_comp.userSpace_mc._visible = true; fhgeneric_comp.userUpArrow_mc._visible = true; fhgeneric_comp.userDownArrow_mc._visible = true; fhgeneric_comp.userHandle_mc._visible = true; fhgeneric_comp.userTop_mc._visible = true; fhgbolMœ R R Mœџџџџ/€€џџџ?џџ=e€€ Layer 2џџџџџOOџ€€€€ Layer 2џџџџџOOџ€џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymbolx  џџxdџ€€eneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџУtџ^#initclip function ChildScroll(pfnCallback) { this.bVertical = fhgeneric_comp.bVertical; this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; this.userBar_mc.Owner = this; } else { this.userBar_mc = bar_mc; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = fhgeneric_comp.topOverlap; this.bottomOverlap = fhgeneric_comp.bottomOverlap; this.upArrowWidth = this.userUpArrow_mc._width; this.downArrowWidth = this.userDownArrow_mc._width; this.userUpArrow_mc.origWidth = this.userUpArrow_mc._width; this.userDownArrow_mc.origWidth = this.userDownArrow_mc._width; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0;џџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџ№џЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџ?vџf // Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function SetResizeVisible(bVisible) { if (!fhgeneric_comp.bVertical) { fhgeneric_comp.bResizeVisible = bVisible; } } function DoHideCursorOnResize(bHideCursorOnResize) { fhgeneric_comp.bHideCursorOnResize = bHideCursorOnResize; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width); } } } if (!fhgeneric_comp.bVertical) { nResult -=5; } } return nResult; } function GetScrollbarWidth() { return fhgeneric_comp.userBar_mc._width } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } function ShowMainScroll() { fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; fhgeneric_comp.userBar_mc._visible = true; fhgeneric_comp.userSpace_mc._visible = true; fhgeneric_comp.userUpArrow_mc._visible = true; fhgeneric_comp.userDownArrow_mc._visible = true; fhgeneric_comp.userHandle_mc._visible = true; fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџ(џZ#initclip function ChildScroll(pfnCallback) { this.bVertical = fhgeneric_comp.bVertical; this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; } else { this.userBar_mc = bar_mc; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = fhgeneric_comp.topOverlap; this.bottomOverlap = fhgeneric_comp.bottomOverlap; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; erUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџWџBo #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; function GenericScrollClass() { this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; Mouse.addListener(this.Owner.resizeListener); }; GenericScrollClass.prototype.EndResize = function() { Mouse.removeListener(this.Owner.resizeListener); if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); }; GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџџ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ Pos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x       !"#$%&'()*+,-./0123456789:;<=>?@ўџџџВ§џџџDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€џџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџТWџЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџFџŽ// Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function SetResizeVisible(bVisible) { fhgeneric_comp.bResizeVisible = bVisible; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { nResult -=5; if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width + 5); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width+5); } } } } return nResult; } function GetScrollbarWidth() { return fhgeneric_comp.userBar_mc._width } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџAXџŒX#initclip function ChildScroll(pfnCallback) { this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; } else { this.userBar_mc = bar_mc; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = yPos+this.userTop_mc._height; this.userBottom_mc._y = this.userHandle_mc._y + this.userHandle_mc._height; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height; } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџ+]џсp #initclip var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; function GenericScrollClass() { this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = 0; this.bottomOverlap = 0; if (this.userTop_mc != undefined) { this.topOverlap = (this.userTop_mc._y +this.userTop_mc._height) - (this.userHandle_mc._y); } if (this.userBottom_mc != undefined) { this.bottomOverlap = (this.userHandle_mc._y + this.userHandle_mc._height) - this.userBottom_mc._y; } // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true)) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; Mouse.addListener(this.Owner.resizeListener); }; GenericScrollClass.prototype.EndResize = function() { Mouse.removeListener(this.Owner.resizeListener); if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); }; GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџŒcџ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџIMџх #initclip var VERTICAL_SKIN = "vertical tripane" var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; var resizeCursorWidth = 9; var resizeCursorHeight = 22; function GenericScrollClass() { _global.NavHost.gVerticalSkin this.bVertical = false; if (_global.NavHost.gVerticalSkin == VERTICAL_SKIN) { this.bVertical = true; } this.bHideCursorOnResize = true; this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; this.scrollBorder_mc.useHandCursor = false; this.resizeCursor_mc = createEmptyMovieClip("ResizeCursor",200) this.resizeCursor_mc.Owner = this; this.resizeCursor_mc.useHandCursor = false; this.resizeCursor_mc._visible = false; this.bResizing = false; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Set Everything initially invisible if (this._parent != _root) { this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; this.userBar_mc._visible = false; this.userSpace_mc._visible = false; this.userUpArrow_mc._visible = false; this.userDownArrow_mc._visible = false; this.userHandle_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; } // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = 0; this.bottomOverlap = 0; if (this.userTop_mc != undefined) { this.topOverlap = (this.userTop_mc._y +this.userTop_mc._height) - (this.userHandle_mc._y); } if (this.userBottom_mc != undefined) { this.bottomOverlap = (this.userHandle_mc._y + this.userHandle_mc._height) - this.userBottom_mc._y; } // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i].useHandCursor = false; this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; this.resizeBar_array[i].onMouseMove = this.MouseOverResize; this.resizeBar_array[i].onRollOut = this.MouseOutResize; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight);a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scrol this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; if (!this.bCurved) { this.userBar_mc.onPress = function() { this.Owner.onBarPress(); } } this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { _parent.debug_alert("onBarPress"); if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; vaSymbol 6 џџџџ[ќSymbol 9џџџџџџџџSиSymbol 5џџџџџџџџџџџџЫг Symbol 3 џџџџџI Symbol 39џџџџбГSymbol 40џџџџџџџџUЗSymbol 41џџџџџџџџџџџџPШSymbol 42#џџџџ˜їмSymbol 50џџџџџџџџџџџџе@лSymbol 51$&џџџџCпмSymbol 52џџџџџџџџџџџџ–3№Symbol 53%)џџџџы3№џџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџQMџЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџЪHџf // Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function SetResizeVisible(bVisible) { if (!fhgeneric_comp.bVertical) { fhgeneric_comp.bResizeVisible = bVisible; } } function DoHideCursorOnResize(bHideCursorOnResize) { fhgeneric_comp.bHideCursorOnResize = bHideCursorOnResize; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = l bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width); } } } if (!fhgeneric_comp.bVertical) { nResult -=5; } } return nResult; } function GetScrollbarWidth() { return fhgeneric_comp.userBar_mc._width } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } function ShowMainScroll() { fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; fhgeneric_comp.userBar_mc._visible = true; fhgeneric_comp.userSpace_mc._visible = true; fhgeneric_comp.userUpArrow_mc._visible = true; fhgeneric_comp.userDownArrow_mc._visible = true; fhgeneric_comp.userHandle_mc._visible = true; fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџ€cџZ#initclip function ChildScroll(pfnCallback) { this.bVertical = fhgeneric_comp.bVertical; this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; } else { this.userBar_mc = bar_mc; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = fhgeneric_comp.topOverlap; this.bottomOverlap = fhgeneric_comp.bottomOverlap; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; if (!this.bCurved) { this.scrollBorder_mc.onMouseMove = this.MouseOverResize; } this.scrollBorder_mc.onRollOut = this.MouseOutResize; // Create the resize cursor this.resizeCursor_mc.clear(); this.resizeCursor_mc.lineStyle(1, 0x000000, 100); this.resizeCursor_mc.beginFill(0x000000, 100); this.resizeCursor_mc.moveTo(0, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight / 2); this.resizeCursor_mc.moveTo(resizeCursorWidth / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth * 2 / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth, resizeCursorHeight / 2); this.resizeCursor_mc.endfill(); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; this.Owner.resizeCursor_mc._visible = false; } else { this.Owner.resizeCursor_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; this.Owner.bResizing = true; if (this.bHideCursorOnResize) { Mouse.hide(); } Mouse.addListener(this.Owner.resizeListener); } GenericScrollClass.prototype.EndResize = function() { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; Mouse.removeListener(this.Owner.resizeListener); this.Owner.bResizing = false; if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); } GenericScrollClass.prototype.MouseOverResize = function() { // Only do something if we are not resizing if (!this.Owner.bResizing) { // See if we are moving over a resize area var bHit = false; if (this.Owner.scrollBorder_mc.hitTest(_xmouse, _ymouse, true) && !this.Owner.bCurved) { bHit = true; } else { if (!this.Owner.userBar_mc.hitTest(_xmouse, _ymouse, true)) { for (var i = 0; i < this.Owner.nResizeWidth; i++) { if (this.Owner.resizeBar_array[i].hitTest(_xmouse, _ymouse, true)) { bHit = true; } } } } // Show (or don't) the resize cursor if (bHit && !this.Owner.bVertical) { if (this.bHideCursorOnResize) { Mouse.hide(); } this.Owner.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; this.Owner.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; this.Owner.resizeCursor_mc._visible = true; } else { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; } } } GenericScrollClass.prototype.MouseOutResize = function() { this.Owner.resizeCursor_mc._visible = false; Mouse.show(); } GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } else { fhgeneric_comp.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; fhgeneric_comp.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ $џ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ r increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; w      !"#$%&'()*+,-./0123ўџџџ6§џџџ89%:;<=>?@ЭBCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€hile (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = th // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeis.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; ChildScroll.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) ight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._ha mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџьQџх #initclip var VERTICAL_SKIN = "vertical tripane" var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; var resizeCursorWidth = 9; var resizeCursorHeight = 22; function GenericScrollClass() { _global.NavHost.gVerticalSkin this.bVertical = false; if (_global.NavHost.gVerticalSkin == VERTICAL_SKIN) { this.bVertical = true; } this.bHideCursorOnResize = true; this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; this.scrollBorder_mc.useHandCursor = false; this.resizeCursor_mc = createEmptyMovieClip("ResizeCursor",200) this.resizeCursor_mc.Owner = this; this.resizeCursor_mc.useHandCursor = false; this.resizeCursor_mc._visible = false; this.bResizing = false; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Set Everything initially invisible if (this._parent != _root) { this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; this.userBar_mc._visible = false; this.userSpace_mc._visible = false; this.userUpArrow_mc._visible = false; this.userDownArrow_mc._visible = false; this.userHandle_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; } // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = 0; this.bottomOverlap = 0; if (this.userTop_mc != undefined) { this.topOverlap = (this.userTop_mc._y +this.userTop_mc._height) - (this.userHandle_mc._y); } if (this.userBottom_mc != undefined) { this.bottomOverlap = (this.userHandle_mc._y + this.userHandle_mc._height) - this.userBottom_mc._y; } // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i].useHandCursor = false; this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; this.resizeBar_array[i].onMouseMove = this.MouseOverResize; this.resizeBar_array[i].onRollOut = this.MouseOutResize; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; if (!this.bCurved) { this.scrollBorder_mc.onMouseMove = this.MouseOverResize; } this.scrollBorder_mc.onRollOut = this.MouseOutResize; // Create the resize cursor this.resizeCursor_mc.clear(); this.resizeCursor_mc.lineStyle(1, 0x000000, 100); this.resizeCursor_mc.beginFill(0x000000, 100); this.resizeCursor_mc.moveTo(0, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight / 2); this.resizeCursor_mc.moveTo(resizeCursorWidth / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth * 2 / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth, resizeCursorHeight / 2); this.resizeCursor_mc.endfill(); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; this.Owner.resizeCursor_mc._visible = false; } else { this.Owner.resizeCursor_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; this.Owner.bResizing = true; if (this.bHideCursorOnResize) { Mouse.hide(); } Mouse.addListener(this.Owner.resizeListener); } GenericScrollClass.prototype.EndResize = function() { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; Mouse.removeListener(this.Owner.resizeListener); this.Owner.bResizing = false; if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); } GenericScrollClass.prototype.MouseOverResize = function() { // Only do something if we are not resizing if (!this.Owner.bResizing) { // See if we are moving over a resize area var bHit = false; if (this.Owner.scrollBorder_mc.hitTest(_xmouse, _ymouse, true) && !this.Owner.bCurved) { bHit = true; } else { if (!this.Owner.userBar_mc.hitTest(_xmouse, _ymouse, true)) { for (var i = 0; i < this.Owner.nResizeWidth; i++) { if (this.Owner.resizeBar_array[i].hitTest(_xmouse, _ymouse, true)) { bHit = true; } } } } // Show (or don't) the resize cursor if (bHit && !this.Owner.bVertical) { if (this.bHideCursorOnResize) { Mouse.hide(); } this.Owner.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; this.Owner.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; this.Owner.resizeCursor_mc._visible = true; } else { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; } } } GenericScrollClass.prototype.MouseOutResize = function() { this.Owner.resizeCursor_mc._visible = false; Mouse.show(); } GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } else { fhgeneric_comp.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; fhgeneric_comp.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ.Yџ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБўџџџГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдўжзий№лмнопрстуфхцч4вџџџџЎьэюяєёђѓ7ѕіїјљњћќ§Aџ‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊўџџџўџџџ§џџџ§џџџжВГ§џџџdHЕG§џџџКНЛžНОПФРСaУ?ХЦЧШЩЪЫЬ+ЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџSymbol 54џџџџџџџџџџџџф3№Symbol 55(+џџџџSмѓSymbol 56џџџџџџџџџџџџМsњSymbol 57*,џџџџEЎќSymbol 34џџџџ SSymbol 35џџџџџџџџrжSymbol 37џџџџџџџџДSSymbol 38џџџџџџџџџџџџŽЃџџџ?џџУ5€ €P( P(Эџ€€џџџ?џџЅS€€ Upџџџџ™3Ьџ€€€€€џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicShape€€џџџџS€Eь‚ƒ„…†‡ˆ‰Š‹ŒŽЋ‘“M—•–А™Вš›АžŸ ЁЂЃЄЅІЇЈЉЊЏЌ­ЎБЯOГСЕЖЗИЙКЛМвОПРЙТУФХЦЧШЩЪЫЬЭЮLаNѓгдежзийклмнопрстуфхцчшщъыьэюя№ёђўџџџєѕіїјљњћќ§ўџSymbol 39#џџџџбГSymbol 40џџџџџџџџUЗSymbol 41џџџџџџџџџџџџPШSymbol 42џџџџ˜їмџі0Ч0X*0ыљ0шў€џ0иП8Эџџ[9џџDџњћ8‹џџЏќџџќя8Oћџъњя8I.ю§џJNњ€€€ ЂџџџЯTџџџ-џџџБ-џџџв -џџџв -џџџѓ TџџџžЂџџџдGіџџџ {гџџџnЂџџџЯ ўџџџ ўџџџGіџџџGіџџџРРXРXРзз):!J@dA]AW@PXџџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymџџџ?џџn€€ LabelsџџџџOџOџ€€РXР@Р@Р@Р@Р@P@P@@@Р@РXРXРXX@@ ўџџџ ўџџџXX ўџџџ ўџџџЂџџџдПџџџЇпџџџRзззˆˆˆˆАˆАˆˆˆРР Œ Œ T T(Œ(Œ)Œ)Œ(((Œ(Œ((!J!J(J(J)T)T)Œ)Œ(J(J((@d@d@Œ@ŒАџџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymbolКџџџ" ЬЬЬЬКџџџ"џ€€џџџ?џџРh€€*" ЬЬЬЬ*"     ўџџџ!§џџџ"#$%&'(J*+,-./0123456789:;<=>?@ABCDEўџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџDџЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); thibol  КёКё dџ€€џџџ?џџYi€€  КёКё dџ€€џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymbol dџ€€џџ€€ LabelsџџџџOџOџ€€ џџџ?џџП6€€  КёКё 7<Шdџ€€џџџ?џџН€€  КёКё 7<Шdџ€€s.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollџџџ?џџ€€  КёКё 7dџ€€ џџџ?џџ'T€€  КёКё #џ€€џџџ?џџc€€ BџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџSBџЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); thiallџџџџO€џџ€€€ЏЦ џЂўџшІўџЏЦџџџџ€€џџџ?џџ(€€ЏЦ џЂўџшІўџЏЦџџџџ€€ џџџ?џџВ1€€ЏЦ џЂўџшІўџЏЦ џs.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScroll€€џџџ?џџ2€€ pointerџџџџ™3Ьџ€€€€џџџ?џџN,€€€ џџџ?џџ`stop(); €€€џџџ?џџ<}stop(); €€€ џџџ?џџхRstop(); €€€џџџ?џџоstop(); €€ ActionsџџџџџOOџ€€€€ џџџ?џџnormalu€€€ џџџ?џџover˜Q€€€џџCPicPageџџ CPicLayerџџ CPicFrame€€d…žџs€Ај§0Pћ00Аџџџ?џџ‚r€€ BGџџџџO€џџ€€€€d…žџs€'АџџCPicPageџџ CPicLayerџџ CPicFrame€€џfџ№3pўx3pўxџџџ?џџ–€€ Layer 1џџџџO€џџ€€џџџ?џџdownB7€€€ џџџ?џџdisabledВ€€€џџџ?џџ €€ LabelsџџџџOџOџ€€€€ ^ђџџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymbol  КёКё dџ€€џџџ?џџЖSBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџЖYџ] // Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function ShowResizeCursor(bShow) { fhgeneric_comp.bShowResizeCursor = bShow; } function SetResizeVisible(bVisible) { if (!fhgeneric_comp.bVertical) { fhgeneric_comp.bResizeVisible = bVisible; } } function DoHideCursorOnResize(bHideCursorOnResize) { fhgeneric_comp.bHideCursorOnResize = bHideCursorOnResize; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width); } } } if (!fhgeneric_comp.bVertical) { nResult -=5; } } return nResult; } function GetScrollbarWidth() { var nWidth = 0; if (!fhgeneric_comp.bCurved) { nWidth = fhgeneric_comp.userBar_mc._width; } else { nWidth = fhgeneric_comp.userBar_mc._width + (fhgeneric_comp.downArrowWidth/2); } return nWidth; } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } function ShowMainScroll() { fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; fhgeneric_comp.userBar_mc._visible = true; fhgeneric_comp.userSpace_mc._visible = true; fhgeneric_comp.userUpArrow_mc._visible = true; fhgeneric_comp.userDownArrow_mc._visible = true; fhgeneric_comp.userHandle_mc._visible = true; fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџž_џb\#initclip function ChildScroll(pfnCallback) { this.bVertical = fhgeneric_comp.bVertical; this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; } else { this.userBar_mc = bar_mc; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=falseight) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџUџх #initclip var VERTICAL_SKIN = "vertical tripane" var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; var resizeCursorWidth = 9; var resizeCursorHeight = 22; function GenericScrollClass() { _global.NavHost.gVerticalSkin this.bVertical = false; if (_global.NavHost.gVerticalSkin == VERTICAL_SKIN) { this.bVertical = true; } this.bHideCursorOnResize = true; this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; this.scrollBorder_mc.useHandCursor = false; this.resizeCursor_mc = createEmptyMovieClip("ResizeCursor",200) this.resizeCursor_mc.Owner = this; this.resizeCursor_mc.useHandCursor = false; this.resizeCursor_mc._visible = false; this.bResizing = false; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Set Everything initially invisible if (this._parent != _root) { this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; this.userBar_mc._visible = false; this.userSpace_mc._visible = false; this.userUpArrow_mc._visible = false; this.userDownArrow_mc._visible = false; this.userHandle_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; } // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = 0; this.bottomOverlap = 0; if (this.userTop_mc != undefined) { this.topOverlap = (this.userTop_mc._y +this.userTop_mc._height) - (this.userHandle_mc._y); } if (this.userBottom_mc != undefined) { this.bottomOverlap = (this.userHandle_mc._y + this.userHandle_mc._height) - this.userBottom_mc._y; } // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i].useHandCursor = false; this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; this.resizeBar_array[i].onMouseMove = this.MouseOverResize; this.resizeBar_array[i].onRollOut = this.MouseOutResize; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; if (!this.bCurved) { this.scrollBorder_mc.onMouseMove = this.MouseOverResize; } this.scrollBorder_mc.onRollOut = this.MouseOutResize; // Create the resize cursor this.resizeCursor_mc.clear(); this.resizeCursor_mc.lineStyle(1, 0x000000, 100); this.resizeCursor_mc.beginFill(0x000000, 100); this.resizeCursor_mc.moveTo(0, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight / 2); this.resizeCursor_mc.moveTo(resizeCursorWidth / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth * 2 / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth, resizeCursorHeight / 2); this.resizeCursor_mc.endfill(); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; this.Owner.resizeCursor_mc._visible = false; } else { this.Owner.resizeCursor_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; this.Owner.bResizing = true; if (this.bHideCursorOnResize) { Mouse.hide(); } Mouse.addListener(this.Owner.resizeListener); } GenericScrollClass.prototype.EndResize = function() { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; Mouse.removeListener(this.Owner.resizeListener); this.Owner.bResizing = false; if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); } GenericScrollClass.prototype.MouseOverResize = function() { // Only do something if we are not resizing if (!this.Owner.bResizing) { // See if we are moving over a resize area var bHit = false; if (this.Owner.scrollBorder_mc.hitTest(_xmouse, _ymouse, true) && !this.Owner.bCurved) { bHit = true; } else { if (!this.Owner.userBar_mc.hitTest(_xmouse, _ymouse, true)) { for (var i = 0; i < this.Owner.nResizeWidth; i++) { if (this.Owner.resizeBar_array[i].hitTest(_xmouse, _ymouse, true)) { bHit = true; } } } } // Show (or don't) the resize cursor if (bHit && !this.Owner.bVertical) { if (this.bHideCursorOnResize) { Mouse.hide(); } this.Owner.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; this.Owner.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; this.Owner.resizeCursor_mc._visible = true; } else { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; } } } GenericScrollClass.prototype.MouseOutResize = function() { this.Owner.resizeCursor_mc._visible = false; Mouse.show(); } GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } else { fhgeneric_comp.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; fhgeneric_comp.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ­Mџ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.      !"#$ўџџџ'§џџџ()*D,-./0123456789:;<=>E@ABC"LFGHIRKўџџџMNOPQЭETUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDe; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = fhgeneric_comp.topOverlap; this.bottomOverlap = fhgeneric_comp.bottomOverlap; this.upArrowWidth = this.userUpArrow_mc._width; this.downArrowWidth = this.userDownArrow_mc._width; this.userUpArrow_mc.origWidth = this.userUpArrow_mc._width; this.userDownArrow_mc.origWidth = this.userDownArrow_mc._width; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildSc€€  КёКё dџ€€ џџџ?џџd€€  КёКё 7<Шdџ€€џџџ?џџь€€  КёКё 7<Шdџ€€џџџ?џџЛi€€  КёКё 7dџ€€ џџџ?џџИ€€  КёКё #џ€€џџџ?џџ/Q€€ BallџџџџO€џџ€€€ЏЎ џЂўџYЏЎџџџџ€€џџџ?џџsF€€ЏЎ џЂўџYЏЎџџџџ€€ џџџ?џџ*€€ЏЎ џЂўџYЏЎ џ€€џџџ?џџе€€ pointerџџџџ™3Ьџ€€€€џџџ?џџи+€€€ џџџ?џџ„=stop(); €€€џџџ?џџгMstop(); €€€ џџџ?џџ stop(); €€€џџџ?џџ~stop(); €€ ActionsџџџџџOOџ€€€€ џџџ?џџnormalО`€efaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (roll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArro€€џџџ?џџ?€€€ џџџ?џџb\stop();€€€џџџ?џџѕmstop();€€ ActionsџџџџџOOџ€€€€ џџџ?џџnormalИ+€€€ џџџ?џџdisabledЎ€€ LablesџџџџO€џџ€€€€Гўџџџџ$dџ$bar_mc€€џџџ?џџJ|this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.Arw_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } returџџCPicPageџџ CPicLayerџџ CPicFrame€€џџџ?џџыџЛ#initclip var miniScroll_array = new Array(); function CreateNewChildScroll(pfnCallback) { this.ScrollYPos = 0; this.ScrollHeight = 0; var newChild = new MiniScroll(pfnCallback); newChild.SetScrollbarPosition(200,100); miniScroll_array.push(newChild); return newChild; } function MiniScroll(pfnCallback) { this.scrollbar = new ChildScroll(pfnCallback); this.scrollID = this.scrollbar.scrollID; } MiniScroll.prototype.SetScrollRange = function(minScroll,maxScroll) { this.scrollbar.minScroll = minScroll; this.scrollbar.maxScroll = maxScroll; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetItemHeight = function(newHeight) { this.scrollbar.itemHeight = newHeight; this.scrollbar.SizeHandle(); } MiniScroll.prototype.SetScrollbarPosition = function(yPos, SCHeight) { this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; this.scrollbar.PositionScrollBar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџЕbџЗ // Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function ShowResizeCursor(bShow) { fhgeneric_comp.bShowResizeCursor = bShow; } function SetResizeVisible(bVisible) { if (!fhgeneric_comp.bVertical) { fhgeneric_comp.bResizeVisible = bVisible; } } function DoHideCursorOnResize(bHideCursorOnResize) { fhgeneric_comp.bHideCursorOnResize = bHideCursorOnResize; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width); } } } if (!fhgeneric_comp.bVertical) { nResult -=5; } } return nResult; } function GetScrollbarWidth() { return fhgeneric_comp.userBar_mc._width } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } function ShowMainScroll() { fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; fhgeneric_comp.userBar_mc._visible = true; fhgeneric_comp.userSpace_mc._visible = true; fhgeneric_comp.userUpArrow_mc._visible = true; fhgeneric_comp.userDownArrow_mc._visible = true; fhgeneric_comp.userHandle_mc._visible = true; fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџiaџZ#initclip function ChildScroll(pfnCallback) { this.bVertical = fhgeneric_comp.bVertical; this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; } else { this.userBar_mc = bar_mc; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = fhgeneric_comp.topOverlap; this.bottomOverlap = fhgeneric_comp.bottomOverlap; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџХpџ=ƒ #initclip var VERTICAL_SKIN = "vertical tripane" var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; var resizeCursorWidth = 9; var resizeCursorHeight = 22; function GenericScrollClass() { _global.NavHost.gVerticalSkin this.bVertical = false; if (_global.NavHost.gVerticalSkin == VERTICAL_SKIN) { this.bVertical = true; } this.bShowResizeCursor = true; this.bHideCursorOnResize = true; this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; this.scrollBorder_mc.useHandCursor = false; this.resizeCursor_mc = createEmptyMovieClip("ResizeCursor",200) this.resizeCursor_mc.Owner = this; this.resizeCursor_mc.useHandCursor = false; this.resizeCursor_mc._visible = false; this.bResizing = false; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Set Everything initially invisible if (this._parent != _root) { this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; this.userBar_mc._visible = false; this.userSpace_mc._visible = false; this.userUpArrow_mc._visible = false; this.userDownArrow_mc._visible = false; this.userHandle_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; } // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = 0; this.bottomOverlap = 0; if (this.userTop_mc != undefined) { this.topOverlap = (this.userTop_mc._y +this.userTop_mc._height) - (this.userHandle_mc._y); } if (this.userBottom_mc != undefined) { this.bottomOverlap = (this.userHandle_mc._y + this.userHandle_mc._height) - this.userBottom_mc._y; } // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i].useHandCursor = false; this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; this.resizeBar_array[i].onMouseMove = this.MouseOverResize; this.resizeBar_array[i].onRollOut = this.MouseOutResize; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height+5; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var newXPos = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (newXPos == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userUpArrow_mc._width/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow newXPos = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (newXPos == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { newXPos -= (this.userDownArrow_mc._width/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; if (!this.bCurved) { this.scrollBorder_mc.onMouseMove = this.MouseOverResize; } this.scrollBorder_mc.onRollOut = this.MouseOutResize; // Create the resize cursor this.resizeCursor_mc.clear(); this.resizeCursor_mc.lineStyle(1, 0x000000, 100); this.resizeCursor_mc.beginFill(0x000000, 100); this.resizeCursor_mc.moveTo(0, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight / 2); this.resizeCursor_mc.moveTo(resizeCursorWidth / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth * 2 / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth, resizeCursorHeight / 2); this.resizeCursor_mc.endfill(); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var newXPos = this.Owner.FindBarEdge(this._y + (this._height/2)); if (newXPos != -123456) { newXPos -= (this._width/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; this.Owner.resizeCursor_mc._visible = false; } else { this.Owner.resizeCursor_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; this.Owner.bResizing = true; if (this.Owner.bHideCursorOnResize) { Mouse.hide(); } Mouse.addListener(this.Owner.resizeListener); } GenericScrollClass.prototype.EndResize = function() { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; Mouse.removeListener(this.Owner.resizeListener); this.Owner.bResizing = false; if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); } GenericScrollClass.prototype.MouseOverResize = function() { // Only do something if we are not resizing if (!this.Owner.bResizing && !this.Owner.bVertical && !this.Owner.bHandleDrag && this.Owner.bShowResizeCursor) { // See if we are moving over a resize area var bHit = false; if (this.Owner.scrollBorder_mc.hitTest(_xmouse, _ymouse, true) && !this.Owner.bCurved) { bHit = true; } else { if (!this.Owner.userBar_mc.hitTest(_xmouse, _ymouse, true) && DisplayResizeCursor()) { for (var i = 0; i < this.Owner.nResizeWidth; i++) { if (this.Owner.resizeBar_array[i].hitTest(_xmouse, _ymouse, true)) { bHit = true; } } } } // Show (or don't) the resize cursor if (bHit) { if (this.Owner.bHideCursorOnResize) { Mouse.hide(); } this.Owner.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; this.Owner.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; this.Owner.resizeCursor_mc._visible = true; } else { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; } } } GenericScrollClass.prototype.MouseOutResize = function() { this.Owner.resizeCursor_mc._visible = false; Mouse.show(); } GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } else { fhgeneric_comp.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; fhgeneric_comp.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } function DisplayResizeCursor() { var bResult = true; if ((fhgeneric_comp.userHandle_mc.hitTest(_xmouse, _ymouse, true) || fhgeneric_comp.userUpArrow_mc.hitTest(_xmouse, _ymouse, true) || fhgeneric_comp.userDownArrow_mc.hitTest(_xmouse, _ymouse, true)) && fhgeneric_comp.enabled) { bResult = false; } for (var i =0; i < miniScroll_array.length; i++) { if ((miniScroll_array[i].scrollbar.userHandle_mc.hitTest(_xmouse, _ymouse, true) || miniScroll_array[i].scrollbar.userUpArrow_mc.hitTest(_xmouse, _ymouse, true) || miniScroll_array[i].scrollbar.userDownArrow_mc.hitTest(_xmouse, _ymouse, true)) && miniScroll_array[i].scrollbar.enabled) { bResult = false; } } return bResult; } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ:џ;#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); if (realBarHeight <= 0 || fhgeneric_comp.realPosition < 0) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ rowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } ‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬўџџџЯ§џџџабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ}; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; if (this.bCurved) { deltaX -= (this.downArrowWidth/2); } this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var nLeftEdge = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (nLeftEdge == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.upArrowWidth/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow nLeftEdge = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (nLeftEdge == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.downArrowWidth/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџ@jџг† #initclip var VERTICAL_SKIN = "vertical tripane" var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; var resizeCursorWidth = 9; var resizeCursorHeight = 22; function GenericScrollClass() { _global.NavHost.gVerticalSkin this.bVertical = false; if (_global.NavHost.gVerticalSkin == VERTICAL_SKIN) { this.bVertical = true; } this.bShowResizeCursor = true; this.bHideCursorOnResize = true; this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; this.scrollBorder_mc.useHandCursor = false; this.resizeCursor_mc = createEmptyMovieClip("ResizeCursor",200) this.resizeCursor_mc.Owner = this; this.resizeCursor_mc.useHandCursor = false; this.resizeCursor_mc._visible = false; this.bResizing = false; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Set Everything initially invisible if (this._parent != _root) { this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; this.userBar_mc._visible = false; this.userSpace_mc._visible = false; this.userUpArrow_mc._visible = false; this.userDownArrow_mc._visible = false; this.userHandle_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; } // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = 0; this.bottomOverlap = 0; this.upArrowWidth = this.userUpArrow_mc._width; this.downArrowWidth = this.userDownArrow_mc._width; this.userUpArrow_mc.origWidth = this.userUpArrow_mc._width; this.userDownArrow_mc.origWidth = this.userDownArrow_mc._width; if (this.userTop_mc != undefined) { this.topOverlap = (this.userTop_mc._y +this.userTop_mc._height) - (this.userHandle_mc._y); } if (this.userBottom_mc != undefined) { this.bottomOverlap = (this.userHandle_mc._y + this.userHandle_mc._height) - this.userBottom_mc._y; } // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i].useHandCursor = false; this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; this.resizeBar_array[i].onMouseMove = this.MouseOverResize; this.resizeBar_array[i].onRollOut = this.MouseOutResize; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } else if (this.bCurved) { for (var i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].scrollbar.onBarPress(); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = f§џџџ      !ўџџџ#$%&'()*J,-./0123456789:;<=>?@ABCDФFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€alse; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; if (this.bCurved) { deltaX -= (this.downArrowWidth/2); } this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height+5; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var nLeftEdge = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (nLeftEdge == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.upArrowWidth/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow nLeftEdge = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (nLeftEdge == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.downArrowWidth/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; if (!this.bCurved) { this.scrollBorder_mc.onMouseMove = this.MouseOverResize; } this.scrollBorder_mc.onRollOut = this.MouseOutResize; // Create the resize cursor this.resizeCursor_mc.clear(); this.resizeCursor_mc.lineStyle(1, 0x000000, 100); this.resizeCursor_mc.beginFill(0x000000, 100); this.resizeCursor_mc.moveTo(0, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight / 2); this.resizeCursor_mc.moveTo(resizeCursorWidth / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth * 2 / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth, resizeCursorHeight / 2); this.resizeCursor_mc.endfill(); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var YPos = this._y + (this._height/2); var nLeftEdge = this.Owner.FindBarEdge(YPos); if (nLeftEdge != -123456) { var nRightEdge = this.Owner.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.origWidth/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; this.Owner.resizeCursor_mc._visible = false; } else if (this.Owner.bShowResizeCursor) { this.Owner.resizeCursor_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; this.Owner.bResizing = true; if (this.Owner.bHideCursorOnResize) { Mouse.hide(); } Mouse.addListener(this.Owner.resizeListener); } GenericScrollClass.prototype.EndResize = function() { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; Mouse.removeListener(this.Owner.resizeListener); this.Owner.bResizing = false; if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); } GenericScrollClass.prototype.MouseOverResize = function() { // Only do something if we are not resizing if (!this.Owner.bResizing && !this.Owner.bVertical && !this.Owner.bHandleDrag && this.Owner.bShowResizeCursor) { // See if we are moving over a resize area var bHit = false; if (this.Owner.scrollBorder_mc.hitTest(_xmouse, _ymouse, true) && !this.Owner.bCurved) { bHit = true; } else { if (!this.Owner.userBar_mc.hitTest(_xmouse, _ymouse, true) && DisplayResizeCursor()) { for (var i = 0; i < this.Owner.nResizeWidth; i++) { if (this.Owner.resizeBar_array[i].hitTest(_xmouse, _ymouse, true)) { bHit = true; } } } } // Show (or don't) the resize cursor if (bHit) { if (this.Owner.bHideCursorOnResize) { Mouse.hide(); } this.Owner.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; this.Owner.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; this.Owner.resizeCursor_mc._visible = true; } else { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; } } } GenericScrollClass.prototype.MouseOutResize = function() { this.Owner.resizeCursor_mc._visible = false; Mouse.show(); } GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } else { fhgeneric_comp.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; fhgeneric_comp.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } function DisplayResizeCursor() { var bResult = true; if ((fhgeneric_comp.userHandle_mc.hitTest(_xmouse, _ymouse, true) || fhgeneric_comp.userUpArrow_mc.hitTest(_xmouse, _ymouse, true) || fhgeneric_comp.userDownArrow_mc.hitTest(_xmouse, _ymouse, true)) && fhgeneric_comp.enabled) { bResult = false; } for (var i =0; i < miniScroll_array.length; i++) { if ((miniScroll_array[i].scrollbar.userHandle_mc.hitTest(_xmouse, _ymouse, true) || miniScroll_array[i].scrollbar.userUpArrow_mc.hitTest(_xmouse, _ymouse, true) || miniScroll_array[i].scrollbar.userDownArrow_mc.hitTest(_xmouse, _ymouse, true)) && miniScroll_array[i].scrollbar.enabled) { bResult = false; } } return bResult; } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџŽMџН#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); // Check for .00001 instead of 0 because flash loses significant digits on some obscure browsers if (realBarHeight <= .00001 || fhgeneric_comp.realPosition < 0 || !fhgeneric_comp.enabled) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ obar_mc€€џџџ?џџ|€€ Barџџџџ™3Ьџ€€€tџџџ` tџџџ` dџє handle_mc€ˆАˆАŒАŒАŒАŒ@Œ@Œ)Œ)ŒАŒАŒ T T)T)T@Œ@Œ Œ Œџџџ?џџ=.€€ Layer 1џџџџO€џџ€€{гџџџnЂџџџЯ ўџџџ џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSprite dџџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymbol`џџџ`џџџ ^ђ^ђ`џџџ`џџџdџ€џџџџ џЂўџџЂўџџџџџџџџџ€€џџџ?џџ=]€€ Layer 1џџџџO€џџ€€џџ?џџnormalr:џ&Ikspace_mc€€џџџ?џџЉ€€ WhitespaceџџџџџOOџ€€€ ГўdџQMbar_mc€€џџџ?џџ1E€€ Barџџџџ™3Ьџ€€€tџџџ` tџџџ` dџЊd handle_mc€xШ xШџџџџ9Зdfhgeneric_compthumbResizeabletrue bResizeableкГО}€oSL„јМт|љМscrollbarCurvedtruebCurved6L@ЦdцEŠFA7nM‚О€€џџџ?џџ€€ џџџ?џџoverP€€€џџџ?џџdownk:€€€ џџџ?џџdisabled[€€€џџџ?џџж€€ LabelsџџџџOџOџ€€џџџ?џџ@56€€ HandleџџџџџOџџ€€€€џџџ?џџH€€ IconџџџџO€џџ€€€€џџџ?џџбџџCPicPageџџ CPicLayerџџ CPicFrame€€ ƒ–ВџћЎИџЄџџ.ЧЖўВ<џЄџ<b ъ88х–їж€M8zКџџ‘+џџџћ<џ^љџќя<žіъњя8 G}ќ§џ@dњЛ№ѕџџдўџџ№ѕџџдўџџ іџџдўџџ іџџдўџџ іџџt іџџt№ѕџџt№ѕџџt іџџдўџџ іџџдўџџ іџџt іџџt№ѕџџt№ѕџџt№ѕџџдўџџ№ѕџџдўџџџџџ?џџз0€€ FGџџџџO€џџ€€€€ TopџџџџџџOџ€€€€џџџ?џџюP€€ BottomџџџџOџџџ€€€xP xPdџ: downarrow_mc€Œ Œdџ4 uparrow_mc€€џџџ?џџЏ €€ ArrowџџџџOџOџ€€€€џџџ?џџ-€€ Componentџџџџ€€€џ€€ ЄЃЅІЇХЉгЋЌ­ЎЏАџџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymbolC$ ЛєџC$џџџџ€€џџџ?џџ’"€€ Bar PlaceholderџџџџOџOџ€€)џџ CDocumentPagePage 1Scene 1ХУІ> џџџџUъ2?џџџџ€ Symbol 38 whitespace&яњП>Џ Symbol 38џџџџ,?џџџџ€ Symbol 35UpDownPointers#ЧѓП> Symbol 35џџџџŸєП>џџџџ€ Symbol 25BarЮА>ю Symbol 25џџџџm?џџџџ€ Symbol 24Tween 1ЎЬА>лџџџџRPЭ>џџџџ€ Symbol 21Icon PlaceholderŽJА>X Symbol 21џџџџCЯА>џџџџ€ Symbol 13Bar Placeholder ђм­>† Symbol 13џџџџъ!Џ>џџџџ€Symbol 7Arrow PlaceholderЯy­>Symbol 7џџџџS!Џ>џџџџ€Symbol 6Handle Top Bottom Placeholderœ}­>$Symbol 6џџџџЗаА>џџџџ€Symbol 9Handle Placeholder  }­>%,Placeholder Graphics/Handle Placeholder copyџџџџУаА>џџџџ€Symbol 5Handle }­> Symbol 5џџџџU^?џџџџ€Symbol 3 DownArrowBalldЬА>йSymbol 3џџџџ^?џџџџ€ Symbol 26 UpArrowBall€вА>DownArrowBall copyџџџџУ]?џџџџ€ Symbol 18 DownArrow†Џ>џ UpArrow copyџџџџ #Џ>џџџџ€Symbol 8 HandleTopё|­>MovieHandle copyџџџџСђП>џџџџ€ Symbol 20IconƒJА>VHandleTop copyџџџџтбА>џџџџ€ Symbol 17 HandleBottomбЏ>ђHandleTop copyџџџџmбА>џџџџ€Symbol 2MovieBar:ФІ>Symbol 2џџџџ§+?џџџџ€ Symbol 22BallЬА>и..\orange\navpane.fla AJ/Tween 1Џ Ž>zБ>ћ#?џџџџ€ Symbol 23pointer0?>7..\orange\navpane.fla AJ/pointeršЏ>0?>7Эю>џџџџ€ Symbol 45HotSpot-<ІИ>Б.\skin_button_nav_next.flaHotSpot<ІИ><ІИ>Б<ІИ>џџџџ€ Symbol 46sync.ЋЧА>Ј.\skin_button_nav_next.flasync*ўэ>ЋЧА>Јю>џџџџ€ Symbol 47 Button BG/уФА>™.\skin_button_nav_next.fla Button BGгњэ>уФА>™!?џџџџ€ Symbol 48search0%$—>U.\skin_button_nav_next.flasearchбњэ>%$—>Uбњэ>џџџџ€ Symbol 57Generic FH Scroll Component9]OИ>gFGenericFHScrollFlashHelp_Components.swf+C:\FlashComponents\FlashHelp_Components.flaGeneric FH Scroll ComponentЖ60?]OИ>gЖ60?thumbResizeabletrue bResizeableкГО}€oSL„јМт|љМscrollbarCurvedfalsebCurved6L@ЦdцEŠFA7nM‚Оџџџџ:џџ CMediaBitsMedia 1bt.png*..\..\..\..\..\..\..\..\..\jonathan\bt.pngC <р—> џџџџ2аpШhhhhџџџџРРРџ Дz PublishRNWKProperties::speed256K0!PublishGifProperties::PaletteName"PublishHtmlProperties::StartPaused0%PublishFormatProperties::htmlFileNametestskin_scrollbar.html PublishQTProperties::LayerOption PublishQTProperties::AlphaOption"PublishQTProperties::MatchMovieDim1PublishHtmlProperties::Loop1Vector::Debugging Permitted0PublishFormatProperties::jpeg0&PublishRNWKProperties::speedSingleISDN0&PublishRNWKProperties::singleRateAudio0PublishQTProperties::Width15$PublishPNGProperties::OptimizeColors1PublishHtmlProperties::Units0%PublishRNWKProperties::mediaCopyright(c) 2000#PublishRNWKProperties::flashBitRate1200PublishGifProperties::Smooth1Vector::Compress Movie1&PublishFormatProperties::flashFileNametestskin_scrollbar.swf%PublishFormatProperties::projectorMac0!PublishRNWKProperties::exportSMIL1 PublishRNWKProperties::speed384K0"PublishRNWKProperties::exportAudio1"PublishGifProperties::DitherOptionPublishHtmlProperties::Quality4(PublishHtmlProperties::VerticalAlignment1$PublishFormatProperties::pngFileNametestskin_scrollbar.pngPublishFormatProperties::html0'PublishRNWKProperties::mediaDescription"PublishPNGProperties::FilterOption!PublishHtmlProperties::DeviceFont0Vector::Override Sounds0PublishQTProperties::Flatten1PublishJpegProperties::DPI4718592PublishPNGProperties::BitDepth24-bit with AlphaPublishPNGProperties::Smooth1"PublishGifProperties::DitherSolids0PublishGifProperties::Interlace0"PublishHtmlProperties::DisplayMenu1*PublishHtmlProperties::HorizontalAlignment1Vector::Quality80Vector::Protect0Vector::Template0*PublishFormatProperties::generatorFileNametestskin_scrollbar.swtPublishFormatProperties::gif0$PublishRNWKProperties::mediaKeywords!PublishRNWKProperties::mediaTitlePublishRNWKProperties::speed28K1PublishGifProperties::Loop1PublishGifProperties::Width15#PublishFormatProperties::qtFileNametestskin_scrollbar.mov$PublishRNWKProperties::speedDualISDN0$PublishRNWKProperties::realVideoRate100000PublishJpegProperties::Quality80"PublishPNGProperties::DitherOption#PublishGifProperties::PaletteOption#PublishGifProperties::MatchMovieDim1PublishFormatProperties::flash1$PublishJpegProperties::MatchMovieDim1#PublishPNGProperties::PaletteOption#PublishPNGProperties::MatchMovieDim1PublishHtmlProperties::Align0-PublishFormatProperties::projectorWinFileNametestskin_scrollbar.exe#PublishQTProperties::PlayEveryFrame0"PublishJpegProperties::Progressive0"PublishPNGProperties::DitherSolids0PublishHtmlProperties::Height250PublishHtmlProperties::Width15Vector::Debugging PasswordVector::Omit Trace Actions0%PublishFormatProperties::jpegFileNametestskin_scrollbar.jpgPublishJpegProperties::Size0PublishPNGProperties::Interlace0PublishGifProperties::Height250'PublishHtmlProperties::TemplateFileNamegC:\Documents and Settings\RLinyard\Application Data\Macromedia\Flash MX\Configuration\Html\Default.html!PublishHtmlProperties::WindowMode0Vector::TopDown0-PublishFormatProperties::projectorMacFileNametestskin_scrollbar.hqxPublishFormatProperties::rnwk0PublishFormatProperties::png0PublishRNWKProperties::speed56K1PublishQTProperties::Height250%PublishPNGProperties::RemoveGradients0PublishGifProperties::MaxColors255'PublishGifProperties::TransparentOptionPublishGifProperties::LoopCountVector::Report0"PublishFormatProperties::generator0"PublishRNWKProperties::audioFormat0$PublishGifProperties::OptimizeColors1Vector::Version6Vector::Event Format0Vector::Stream Compress7PublishFormatProperties::qt0 PublishRNWKProperties::speed512K0PublishJpegProperties::Height250PublishPNGProperties::Height250PublishPNGProperties::Width15%PublishGifProperties::RemoveGradients0PublishHtmlProperties::Scale0Vector::Event Compress7"PublishRNWKProperties::mediaAuthor(PublishRNWKProperties::speedCorporateLAN0&PublishRNWKProperties::showBitrateDlog1"PublishRNWKProperties::exportFlash1PublishQTProperties::Looping0*PublishQTProperties::UseQTSoundCompression0PublishJpegProperties::Width15!PublishPNGProperties::PaletteName!PublishPNGProperties::Transparent0&PublishGifProperties::TransparentAlpha128PublishGifProperties::Animated0Vector::Stream Format0$PublishFormatProperties::gifFileNametestskin_scrollbar.gifPropSheet::ActiveTab1599"PublishQTProperties::PausedAtStart0%PublishQTProperties::ControllerOption0PublishPNGProperties::MaxColors255%PublishFormatProperties::rnwkFileNametestskin_scrollbar.smil%PublishFormatProperties::projectorWin0%PublishFormatProperties::defaultNames1џџџџ§џџ CColorDefџ€џ€џ€3џPя€fџPя0€™џPяH€ЬџPя`€џџPяx€3џя€33џ(я€3fџ<я0€3™џCяH€3ЬџFя`€3џџHяx€fџя0€f3џя0€ffџ(я0€f™џ5яH€fЬџ<я`€fџџ@яx€џ€333џ0€џ€3џ я€33џxя€f3џdя0€™3џ]яH€Ь3џZя`€џ3џXяx€33џШя€333џ0€3f3џPPH€3™3џPx`€3Ь3џPx€3џ3џPя€f3џмя0€f33џPH€ff3џ(PH€f™3џ<x`€fЬ3џCx€fџ3џFя€џ€fffџ`€џ€fџ я0€3fџŒя0€ffџxя0€™fџkяH€Ьfџdя`€џfџ`яx€3fџДя0€33fџ PH€3ffџxPH€3™fџdx`€3Ьfџ]x€3џfџZя€ffџШя0€f3fџШPH€fffџ`€f™fџP0x€fЬfџPx€fџfџPяЈ€џ€™™™џ€џ€™џ яH€3™џ“яH€f™џ…яH€™™џxяH€Ь™џnя`€џ™џhяx€3™џ­яH€33™џ x`€3f™џŒx`€3™™џxx`€3Ь™џkx€3џ™џdя€f™џЛяH€f3™џДx`€ff™џ 0x€f™™џx0x€fЬ™џdx€fџ™џ]яЈ€џ€ЬЬЬџР€џ€Ьџ я`€3Ьџ–я`€fЬџŒя`€™Ьџ‚я`€ЬЬџxя`€џЬџpяx€3ЬџЊя`€33Ьџ x€3fЬџ“x€3™Ьџ…x€3ЬЬџxx€3џЬџnя€fЬџДя`€f3Ьџ­x€ffЬџ x€f™ЬџŒx€fЬЬџxx€fџЬџkяЈ€џ€џџџџ№€џ€џџ яx€3џџ˜яx€fџџяx€™џџˆяx€Ьџџ€яx€џџџxяx€3џџЈяx€33џџ я€3fџџ–я€3™џџŒя€3Ьџџ‚я€3џџџxя€fџџАяx€f3џџЊя€ffџџ яЈ€f™џџ“яЈ€fЬџџ…яЈ€fџџџxяЈ€џ€џџяx€џ€™џяH€™3џ яH€™fџяH€™™џ(яH€™Ьџ2я`€™џџ8яx€Ьџя`€Ь3џ я`€Ьfџя`€Ь™џя`€ЬЬџ(я`€Ьџџ0яx€џџяx€џ3џяx€џfџяx€џ™џяx€џЬџ яx€џџџ(яx€џ€џџPяx€џ€™3џуяH€™33џx`€™f3џx`€™™3џ(x`€™Ь3џ5x€™џ3џ<я€Ь3џця`€Ь33џx€Ьf3џ x€Ь™3џx€ЬЬ3џ(x€Ьџ3џ2я€џ3џшяx€џ33џя€џf3џ я€џ™3џя€џЬ3џя€џџ3џ(я€џ€џџ яx€џ€™fџеяH€™3fџмx`€™ffџ0x€™™fџ(0x€™Ьfџ<x€™џfџCяЈ€Ьfџмя`€Ь3fџуx€Ьffџx€Ь™fџx€ЬЬfџ(x€Ьџfџ5яЈ€џfџряx€џ3fџця€џffџяЈ€џ™fџ яЈ€џЬfџяЈ€џџfџ(яЈ€џ€џџџ(яx€џ€™™џШяH€™3™џШx`€™f™џШ0x€™™™џ€™Ь™џPPЈ€™џ™џPяР€Ь™џвя`€Ь3™џеx€Ьf™џмx€Ь™™џPЈ€ЬЬ™џ(PЈ€Ьџ™џ<яР€џ™џияx€џ3™џмя€џf™џуяЈ€џ™™џяР€џЬn; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; if (this.bCurved) { deltaX -= (this.downArrowWidth/2); } this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var nLeftEdge = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (nLeftEdge == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.upArrowWidth/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow nLeftEdge = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (nLeftEdge == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.downArrowWidth/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџсџN† #initclip var VERTICAL_SKIN = "vertical tripane" var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; var resizeCursorWidth = 9; var resizeCursorHeight = 22; function GenericScrollClass() { _global.NavHost.gVerticalSkin this.bVertical = false; if (_global.NavHost.gVerticalSkin == VERTICAL_SKIN) { this.bVertical = true; } this.bShowResizeCursor = true; this.bHideCursorOnResize = true; this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; this.scrollBorder_mc.useHandCursor = false; this.resizeCursor_mc = createEmptyMovieClip("ResizeCursor",200) this.resizeCursor_mc.Owner = this; this.resizeCursor_mc.useHandCursor = false; this.resizeCursor_mc._visible = false; this.bResizing = false; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Set Everything initially invisible if (this._parent != _root) { this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; this.userBar_mc._visible = false; this.userSpace_mc._visible = false; this.userUpArrow_mc._visible = false; this.userDownArrow_mc._visible = false; this.userHandle_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; } // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = 0; this.bottomOverlap = 0; this.upArrowWidth = this.userUpArrow_mc._width; this.downArrowWidth = this.userDownArrow_mc._width; this.userUpArrow_mc.origWidth = this.userUpArrow_mc._width; this.userDownArrow_mc.origWidth = this.userDownArrow_mc._width; if (this.userTop_mc != undefined) { this.topOverlap = (this.userTop_mc._y +this.userTop_mc._height) - (this.userHandle_mc._y); } if (this.userBottom_mc != undefined) { this.bottomOverlap = (this.userHandle_mc._y + this.userHandle_mc._height) - this.userBottom_mc._y; } // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i].useHandCursor = false; this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; this.resizeBar_array[i].onMouseMove = this.MouseOverResize; this.resizeBar_array[i].onRollOut = this.MouseOutResize; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; if (this.bCurved) { deltaX -= (this.downArrowWidth/2); } this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height+5; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var nLeftEdge = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (nLeftEdge == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.upArrowWidth/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow nLeftEdge = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (nLeftEdge == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.downArrowWidth/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; if (!this.bCurved) { this.scrollBorder_mc.onMouseMove = this.MouseOverResize; } this.scrollBorder_mc.onRollOut = this.MouseOutResize; // Create the resize cursor this.resizeCursor_mc.clear(); this.resizeCursor_mc.lineStyle(1, 0x000000, 100); this.resizeCursor_mc.beginFill(0x000000, 100); this.resizeCursor_mc.moveTo(0, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight / 2); this.resizeCursor_mc.moveTo(resizeCursorWidth / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth * 2 / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth, resizeCursorHeight / 2); this.resizeCursor_mc.endfill(); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var YPos = this._y + (this._height/2); var nLeftEdge = this.Owner.FindBarEdge(YPos); if (nLeftEdge != -123456) { var nRightEdge = this.Owner.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.origWidth/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; this.Owner.resizeCursor_mc._visible = false; } else if (this.Owner.bShowResizeCursor) { this.Owner.resizeCursor_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; this.Owner.bResizing = true; if (this.Owner.bHideCursorOnResize) { Mouse.hide(); } Mouse.addListener(this.Owner.resizeListener); } GenericScrollClass.prototype.EndResize = function() { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; Mouse.removeListener(this.Owner.resizeListener); this.Owner.bResizing = false; if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); } GenericScrollClass.prototype.MouseOverResize = function() { // Only do something if we are not resizing if (!this.Owner.bResizing && !this.Owner.bVertical && !this.Owner.bHandleDrag && this.Owner.bShowResizeCursor) { // See if we are moving over a resize area var bHit = false; if (this.Owner.scrollBorder_mc.hitTest(_xmouse, _ymouse, true) && !this.Owner.bCurved) { bHit = true; } else { if (!this.Owner.userBar_mc.hitTest(_xmouse, _ymouse, true) && DisplayResizeCursor()) { for (var i = 0; i < this.Owner.nResizeWidth; i++) { if (this.Owner.resizeBar_array[i].hitTest(_xmouse, _ymouse, true)) { bHit = true; } } } } // Show (or don't) the resize cursor if (bHit) { if (this.Owner.bHideCursorOnResize) { Mouse.hide(); } this.Owner.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; this.Owner.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; this.Owner.resizeCursor_mc._visible = true; } else { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; } } } GenericScrollClass.prototype.MouseOutResize = function() { this.Owner.resizeCursor_mc._visible = false; Mouse.show(); } GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } else { fhgeneric_comp.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; fhgeneric_comp.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } function DisplayResizeCursor() { var bResult = true; if ((fhgeneric_comp.userHandle_mc.hitTest(_xmouse, _ymouse, true) || fhgeneric_comp.userUpArrow_mc.hitTest(_xmouse, _ymouse, true) || fhgeneric_comp.userDownArrow_mc.hitTest(_xmouse, _ymouse, true)) && fhgeneric_comp.enabled) { bResult = false; } for (var i =0; i < miniScroll_array.length; i++) { if ((miniScroll_array[i].scrollbar.userHandle_mc.hitTest(_xmouse, _ymouse, true) || miniScroll_array[i].scrollbar.userUpArrow_mc.hitTest(_xmouse, _ymouse, true) || miniScroll_array[i].scrollbar.userDownArrow_mc.hitTest(_xmouse, _ymouse, true)) && miniScroll_array[i].scrollbar.enabled) { bResult = false; } } return bResult; } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџ‘^џН#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); // Check for .00001 instead of 0 because flash loses significant digits on some obscure browsers if (realBarHeight <= .00001 || fhgeneric_comp.realPosition < 0 || !fhgeneric_comp.enabled) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ Bar(yPos, SCHeight); } MiniScroll.prototype.SetHandlePosition = function(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; this.scrollbar.MoveHandleToPosition(newPosition); this.scrollbar.realPosition = newPosition; } MiniScroll.prototype.Show = function(bVisible) { this.scrollbar.Show(bVisible); } #endinitclip€€ Child Scroll CommandsџџџџџOOџ€€€€џџџ?џџ1џ] // Include the ActionScript files that know how to communicate with the // Nav Host. #initclip function SetScrollRange(minScroll,maxScroll) { fhgeneric_comp.minScroll = minScroll; fhgeneric_comp.maxScroll = maxScroll; fhgeneric_comp.SizeHandle(); } function SetItemHeight(newHeight) { fhgeneric_comp.itemHeight = newHeight; fhgeneric_comp.SizeHandle(); } function SetScrollbarPosition(yPos, SCHeight) { fhgeneric_comp.PositionScrollBar(yPos, SCHeight); } function SetSpaceColor(newColor) { fhgeneric_comp.SetBgColor(newColor); } function ShowResizeCursor(bShow) { fhgeneric_comp.bShowResizeCursor = bShow; } function SetResizeVisible(bVisible) { if (!fhgeneric_comp.bVertical) { fhgeneric_comp.bResizeVisible = bVisible; } } function DoHideCursorOnResize(bHideCursorOnResize) { fhgeneric_comp.bHideCursorOnResize = bHideCursorOnResize; } function SetHandlePosition(newPosition) { currentItem = _parent.curScrollItem.pfnScroll; fhgeneric_comp.MoveHandleToPosition(newPosition); fhgeneric_comp.realPosition = newPosition; } function GetScrollEdgeAtPos(yPos) { nResult = Stage.width; if (fhgeneric_comp.bCurved) { nResult = fhgeneric_comp.FindBarEdge(yPos); } else { if (yPos>fhgeneric_comp.ScrollYPos && yPos < fhgeneric_comp.ScrollYPos+fhgeneric_comp.ScrollHeight) { nResult = Stage.width - (fhgeneric_comp.userBar_mc._width); } else { for (i=0; i< miniScroll_array.length;i++) { if (yPos>miniScroll_array[i].ScrollYPos && yPos < miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { nResult = Stage.width - (miniScroll_array[i].scrollbar.userBar_mc._width); } } } if (!fhgeneric_comp.bVertical) { nResult -=5; } } return nResult; } function GetScrollbarWidth() { var nWidth = 0; if (!fhgeneric_comp.bCurved) { nWidth = fhgeneric_comp.userBar_mc._width; } else { nWidth = fhgeneric_comp.userBar_mc._width + (fhgeneric_comp.downArrowWidth/2); } return nWidth; } function HideAllMiniScroll() { var i = 0; for (i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].Show(false); } } function ShowMainScroll() { fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; fhgeneric_comp.userBar_mc._visible = true; fhgeneric_comp.userSpace_mc._visible = true; fhgeneric_comp.userUpArrow_mc._visible = true; fhgeneric_comp.userDownArrow_mc._visible = true; fhgeneric_comp.userHandle_mc._visible = true; fhgeneric_comp.userTop_mc._visible = true; fhgeneric_comp.userBottom_mc._visible = true; fhgeneric_comp.userIcon_mc._visible = true; } #endinitclip€€ Scrollbar commandsџџџџџOOџ€€€€џџџ?џџ\nџ^#initclip function ChildScroll(pfnCallback) { this.bVertical = fhgeneric_comp.bVertical; this.pfnCallback = pfnCallback; this.bCurved = fhgeneric_comp.bCurved this.bResizeable = fhgeneric_comp.bResizeable; if (this.bCurved) { this.bResizeable = false; } if (!this.bCurved) { this.userBar_mc = bar_mc.duplicateMovieClip("bar"+levelCount,levelCount++); this.userBar_mc.tabEnabled = false; this.userBar_mc.Owner = this; } else { this.userBar_mc = bar_mc; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.scrollID = levelCount; this.userUpArrow_mc = uparrow_mc.duplicateMovieClip("uparrow"+levelCount,levelCount++); this.userDownArrow_mc = downarrow_mc.duplicateMovieClip("downarrow"+levelCount,levelCount++); this.userHandle_mc = handle_mc.duplicateMovieClip("handle"+levelCount,levelCount++); this.userTop_mc = top_mc.duplicateMovieClip("top"+levelCount,levelCount++); this.userBottom_mc = bottom_mc.duplicateMovieClip("bottom"+levelCount,levelCount++); this.userIcon_mc = icon_mc.duplicateMovieClip("icon"+levelCount,levelCount++); this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; this.enabled = true; this.bPlayDisabled = true; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = fhgeneric_comp.topOverlap; this.bottomOverlap = fhgeneric_comp.bottomOverlap; this.upArrowWidth = this.userUpArrow_mc._width; this.downArrowWidth = this.userDownArrow_mc._width; this.userUpArrow_mc.origWidth = this.userUpArrow_mc._width; this.userDownArrow_mc.origWidth = this.userDownArrow_mc._width; // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 10; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 500; this.realPosition = 0; this.bResize = false; // This variable prevents us from changing data due to calculations // that cause the loss of significant digits // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; this.bOver = false; // Initialize Object this.Init(); } ChildScroll.prototype = new MovieClip(); ChildScroll.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height) this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } // Create movie event handlers this.userHandle_mc.Owner = this; this.userIcon_mc.Owner = this; this.userTop_mc.Owner = this; this.userBottom_mc.Owner = this; this.userBar_mc.Owner = this; this.userUpArrow_mc.Owner = this; this.userDownArrow_mc.Owner = this; this.userSpace_mc.Owner = this; this.userHandle_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userHandle_mc.onPress = function() { this.Owner.onHandlePress(); }; if (!this.bCurved) { this.userBar_mc.onPress = function() { this.Owner.onBarPress(); } } this.userHandle_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userTop_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userTop_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userTop_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userBottom_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userBottom_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userBottom_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userIcon_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onHandleRollOver(); }; this.userIcon_mc.onPress = function() { this.Owner.onHandlePress(); }; this.userIcon_mc.onRollOut = function() { this.Owner.onHandleRollOut(); }; this.userUpArrow_mc.onPress = function() { this.Owner.onUpArrowPress(); }; this.userUpArrow_mc.onRelease = function() { this.Owner.onUpArrowRelease(); }; this.userUpArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onUpArrowRollOver(); }; this.userUpArrow_mc.onRollOut = function() { this.Owner.onUpArrowRollOut(); }; this.userUpArrow_mc.onDragOut = function() { this.Owner.onUpArrowDragOut(); }; this.userDownArrow_mc.onPress = function() { this.Owner.onDownArrowPress(); }; this.userDownArrow_mc.onRelease = function() { this.Owner.onDownArrowRelease(); }; this.userDownArrow_mc.onRollOver = function() { this.useHandCursor = false; this.Owner.onDownArrowRollOver(); }; this.userDownArrow_mc.onRollOut = function() { this.Owner.onDownArrowRollOut(); }; this.userDownArrow_mc.onDragOut = function() { this.Owner.onDownArrowDragOut(); }; }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page ChildScroll.prototype.onBarPress = function() { _parent.debug_alert("onBarPress"); if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } }; ChildScroll.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; ChildScroll.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle ChildScroll.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle ChildScroll.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; testPos = (truePosition)/(this.maxScroll - this.ScrollHeight); realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { this.PositionChanged(); } }; ChildScroll.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; ChildScroll.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } ChildScroll.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } ChildScroll.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } ChildScroll.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); this.PositionChanged(); }; ChildScroll.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; ChildScroll.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } ChildScroll.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; ChildScroll.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; ChildScroll.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; ChildScroll.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"™џяР€џџ™џ(яР€џ€џџџxяx€џ€™ЬџОя`€™3ЬџЛx€™fЬџДx€™™Ьџ PЈ€™ЬЬџxPЈ€™џЬџdяР€ЬЬџШя`€Ь3ЬџШx€ЬfЬџШx€Ь™ЬџШPЈ€ЬЬЬџР€ЬџЬџPяи€џЬџаяx€џ3Ьџвя€џfЬџеяЈ€џ™ЬџмяР€џЬЬџяи€џџЬџ(яи€џ€џџџШяx€џ€™џџИяx€™3џџДя€™fџџ­яЈ€™™џџ яР€™ЬџџŒяР€™џџџxяР€ЬџџРяx€Ь3џџОя€ЬfџџЛяЈ€Ь™џџДяР€ЬЬџџ яи€Ьџџџxяи€џџџШяx€џ3џџШя€џfџџШяЈ€џ™џџШяР€џЬџџШяи€џџџџ№€џ€d…žџŠ8z€џџџџџџџ€џџџџџџџ€џџџџџ€џџџџџ€џџџџџ яx€џf§џ`џџџџzџџџџ€™fџЊџЬџџџџџџ€џџџ*џџџ]џџџџџЊџџдџџџџџџqh:€Placeholder Graphicsџџџџ"PublishQTProperties::QTSndSettingsџџCQTAudioSettingsџџШ); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; ChildScroll.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); this.PositionChanged(); } }; ChildScroll.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; ChildScroll.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; ChildScroll.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// ChildScroll.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; ChildScroll.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; ChildScroll.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; ChildScroll.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; ChildScroll.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; ChildScroll.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; ChildScroll.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -=5; } var deltaX = newXPos - this.userBar_mc._x; if (this.bCurved) { deltaX -= (this.downArrowWidth/2); } this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (!this.bCurved) { this.userBar_mc._x += deltaX; this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; } this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var nLeftEdge = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (nLeftEdge == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.upArrowWidth/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow nLeftEdge = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (nLeftEdge == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.downArrowWidth/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } } this.SizeHandle(); } ChildScroll.prototype.Show = function(bVisible) { if (!this.bCurved) { this.userBar_mc._visible = bVisible; } this.userUpArrow_mc._visible = bVisible; this.userDownArrow_mc._visible = bVisible; this.userHandle_mc._visible = bVisible; this.userTop_mc._visible = bVisible; this.userBottom_mc._visible = bVisible; this.userIcon_mc._visible = bVisible; } ChildScroll.prototype.PositionChanged = function() { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = this.GetHandleYPos() - (this.userUpArrow_mc._y + this.upArrowHeight); // Save the current posiiton for when the scrollbar is resized this.realPosition = ((realPos / realBarHeight)*(this.maxScroll - this.ScrollHeight)); if (realBarHeight <= 0 || this.realPosition < 0) { this.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { this.pfnCallback(this.realPosition); } } #endinitclip€€ Child Scroll ActionsџџџџO€џџ€€€€џџџ?џџГaџoˆ #initclip var RESIZEBAR_TIMEOUT = 2000; // 2 Seconds var VERTICAL_SKIN = "vertical tripane" var minMiddleHeight =20; var wheelDeltaBase = 120; var levelCount = 1; var resizeCursorWidth = 9; var resizeCursorHeight = 22; function GenericScrollClass() { _global.NavHost.gVerticalSkin this.bVertical = false; if (_global.NavHost.gVerticalSkin == VERTICAL_SKIN) { this.bVertical = true; } this.bShowResizeCursor = true; this.bHideCursorOnResize = true; this.bResizeVisible = false; this.resizeListener = new Object; this.nResizeWidth = 4; this.scrollBorder_mc = createEmptyMovieClip("ScrollBorder",levelCount++) this.scrollBorder_mc.Owner = this; this.scrollBorder_mc.useHandCursor = false; this.resizeCursor_mc = createEmptyMovieClip("ResizeCursor",200) this.resizeCursor_mc.Owner = this; this.resizeCursor_mc.useHandCursor = false; this.resizeCursor_mc._visible = false; this.resizeInterval = undefined; this.bResizing = false; if (this.bCurved) { this.userSpace_mc = this._parent.space_mc; this.spaceBg_mc = createEmptyMovieClip("SpaceColor",-16384); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.spaceBg_mc.setMask(this.userSpace_mc); this.spaceBg_mc.onPress = function() {}; this.spaceBg_mc.useHandCursor = false; this.spaceBgColor = 0xffffff; this.CreateResizeBar(); this.bResizeable = false; this.scrollBorder_mc._visible = false; } else { this._parent.space_mc._visible = false; } if (this.bVertical) { this.scrollBorder_mc._visible = false; this.bResizeVisible = false; } this.enabled = true; this.bPlayDisabled = true; this.userBar_mc = this._parent.bar_mc; this.userUpArrow_mc = this._parent.uparrow_mc; this.userDownArrow_mc = this._parent.downarrow_mc; // Used to get the scroll position this.actualBar = Stage.height; // Handle Variables this.dragYPos = 0; this.bHandleDrag = false; this.userHandle_mc = this._parent.handle_mc; this.mouseListener = new Object(); this.mouseListener.Owner = this; this.mouseInterval = undefined; // Handle objects for resizeable scrollbar this.userTop_mc = this._parent.top_mc; this.userBottom_mc = this._parent.bottom_mc; this.userIcon_mc = this._parent.icon_mc; this.userBar_mc.tabEnabled=false; this.userSpace_mc.tabEnabled=false; this.userUpArrow_mc.tabEnabled=false; this.userDownArrow_mc.tabEnabled=false; this.userHandle_mc.tabEnabled=false; this.userTop_mc.tabEnabled=false; this.userBottom_mc.tabEnabled=false; this.userIcon_mc.tabEnabled=false; // Set Everything initially invisible if (this._parent != _root) { this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; this.userBar_mc._visible = false; this.userSpace_mc._visible = false; this.userUpArrow_mc._visible = false; this.userDownArrow_mc._visible = false; this.userHandle_mc._visible = false; this.userTop_mc._visible = false; this.userBottom_mc._visible = false; this.userIcon_mc._visible = false; } // Arrow Variables this.bArrowPressed = false; this.ArrowInterval = undefined; this.bArrowIntervalFirst = false; this.nArrowMoveScroll = 0; // Original Sizes - used for scaling and positioning this.handleHeight = this.userHandle_mc._height; this.origHandleHeight = 0; this.origHandleWidth = this.userHandle_mc._width; this.barHeight = this.userBar_mc._height; this.barWidth = this.userBar_mc._width; this.upArrowHeight = this.userUpArrow_mc._height; this.downArrowHeight = this.userDownArrow_mc._height; this.topOverlap = 0; this.bottomOverlap = 0; this.upArrowWidth = this.userUpArrow_mc._width; this.downArrowWidth = this.userDownArrow_mc._width; this.userUpArrow_mc.origWidth = this.userUpArrow_mc._width; this.userDownArrow_mc.origWidth = this.userDownArrow_mc._width; if (this.userTop_mc != undefined) { this.topOverlap = (this.userTop_mc._y +this.userTop_mc._height) - (this.userHandle_mc._y); } if (this.userBottom_mc != undefined) { this.bottomOverlap = (this.userHandle_mc._y + this.userHandle_mc._height) - this.userBottom_mc._y; } // current scrollbar position and height set by the navigation components relative to the stage this.ScrollYPos = 0; this.ScrollHeight = Stage.height; // used to calculate the arrowIncrement value this.itemHeight = 20; // distance to move the thumb up of down this.arrowIncrement=0; // find the position of the icon relative to the top of the bar this.iconCenterPos = (this.userIcon_mc._y +(this.userIcon_mc._height/2)) - this.userHandle_mc._y; // relative icon x pos this.relIconXPos = this.userIcon_mc._x - this.userHandle_mc._x; // Runtime varibles this.pageSize = 0; this.minScroll = 0; this.maxScroll = 1000; this.realPosition = 0; this.bOver = false; // Initialize Object this.Init(); } GenericScrollClass.prototype = new MovieClip(); GenericScrollClass.prototype.CreateResizeBar = function () { this.resizeBar_array = new Array(); var i = 0; for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i] = bar_mc.duplicateMovieClip("Resizebar"+levelCount,levelCount++); this.resizeBar_array[i].useHandCursor = false; this.resizeBar_array[i]._alpha = 0; this.resizeBar_array[i].onPress = this.BeginResize; this.resizeBar_array[i].onRelease = this.EndResize; this.resizeBar_array[i].onReleaseOutside = this.EndResize; this.resizeBar_array[i].Owner = this; this.resizeBar_array[i].onMouseMove = this.MouseOverResize; this.resizeBar_array[i].onRollOut = this.MouseOutResize; } this.SetResizeDepth(); } GenericScrollClass.prototype.PositionResizeBar = function () { for (i = 0; i < this.nResizeWidth; i++) { this.resizeBar_array[i]._x = this.userBar_mc._x + (i+1); this.resizeBar_array[i]._height = this.userBar_mc._height; this.resizeBar_array[i]._y = this.userBar_mc._y; } } GenericScrollClass.prototype.SetResizeBarDepth = function () { var mc_array = new Array(); if (this.userSpace_mc !=undefined) { mc_array.push(this.userSpace_mc); } if (this.userBar_mc !=undefined) { mc_array.push(this.userBar_mc); } if (this.userHandle_mc !=undefined) { mc_array.push(this.userHandle_mc); } if (this.userIcon_mc !=undefined) { mc_array.push(this.userIcon_mc); } if (this.userTop_mc !=undefined) { mc_array.push(this.userTop_mc); } if (this.userBottom_mc !=undefined) { mc_array.push(this.userBottom_mc); } if (this.userUpArrow_mc !=undefined) { mc_array.push(this.userUpArrow_mc); } if (this.userDownArrow_mc !=undefined) { mc_array.push(this.userDownArrow_mc); } var nOffset = this.nResizeWidth; var i = 0; while (mc_array[i+nOffset] != undefined) { mc_array[i].swapDepths(mc_array[i+nOffset]); i++; } var lastIndex = i; for (i = 0; i < this.nResizeWidth; i++) { mc_array[lastIndex + i].swapDepths(this.resizeBar_array[i]); } } GenericScrollClass.prototype.Init = function () { // Position Items this.PositionScrollBar(0,Stage.height); this.origHandleHeight = this.GetHandleHeight(); this.GotoDefaultUpArrowState() this.GotoDefaultDownArrowState() this.GotoDefaultBarState() this.GotoDefaultHandleState(); // Handle should appear at the top of the bar this.SetHandleYPos(this.userBar_mc._y + this.upArrowHeight); // Set the resizebar depth if (this.bCurved) { this.SetResizeBarDepth(); } // Create a mouse listener for the mouse up handle event this.mouseListener.onMouseUp = function () { this.Owner.onMouseRelease(); } }; // This function handles the case when the user clicks directly on the scroll bar. It should move // the thumb up or down one page GenericScrollClass.prototype.onBarPress = function() { if (_ymouse >this.userUpArrow_mc._y && _ymouse < this.userDownArrow_mc._y) { if (_ymouse > this.GetHandleYPos()) { this.MoveHandle(0,this.pageSize); } else { this.MoveHandle(0,-this.pageSize); } } else if (this.bCurved) { for (var i=0; i< miniScroll_array.length;i++) { miniScroll_array[i].scrollbar.onBarPress(); } } }; GenericScrollClass.prototype.EnableItem = function () { this.enabled = true; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); }; GenericScrollClass.prototype.DisableItem = function () { if (this.enabled == true) { this.bPlayDisabled = true; } this.enabled = false; this.userBar_mc.useHandCursor = false; this.userUpArrow_mc.useHandCursor = false; this.userDownArrow_mc.useHandCursor = false; this.GotoDefaultUpArrowState(); this.GotoDefaultDownArrowState(); this.GotoDefaultBarState(); this.GotoDefaultHandleState(); this.bPlayDisabled = false; }; // Used to calculate the size of the handle GenericScrollClass.prototype.SizeHandle = function() { // The height of the object that will be scrolled var scrollHeight = this.MaxScroll - this.MinScroll; // The Display area var paneHeight = this.ScrollHeight; // Calculate the area where the handle can display var scrollRegion = this.actualBar; // The new Handle height var handleHeight = (paneHeight / scrollHeight)*scrollRegion; // Set the page size this.pageSize = handleHeight; // Set the handle increment if (this.bResizeable) { this.arrowIncrement = (this.pageSize*this.itemHeight)/paneHeight; } else { this.arrowIncrement = (this.itemHeight * (this.actualBar - this.GetHandleHeight()))/(this.maxScroll - this.ScrollHeight); } if (this.bResizeable) { this.SetHandleHeight(handleHeight); } if ((this.GetHandleHeight() > scrollRegion) || (scrollHeight < paneHeight)) { if (this.bResizeable) { this.SetHandleHeight(scrollRegion); } this.DisableItem(); } else if (!this.enabled) { this.EnableItem(); } // Set the new Handle position this.MoveHandleToPosition(this.realPosition); }; // Used to position the handle GenericScrollClass.prototype.MoveHandleToPosition = function(truePosition) { // Get the scrollbar height barHeight = this.actualBar; // Get the thumb height thumbHeight = this.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; realPos = (truePosition*realBarHeight)/(this.maxScroll - this.ScrollHeight); this.SetHandleYPos(realPos + this.userUpArrow_mc._y + this.upArrowHeight); if (this.MakeHandleInBar()) { PositionChanged(); } }; GenericScrollClass.prototype.MakeHandleInBar = function() { var bMoved = false; if ((this.GetHandleYPos() + this.GetHandleHeight()) >= this.userDownArrow_mc._y) { this.SetHandleYPos(this.userDownArrow_mc._y - this.GetHandleHeight()); bMoved = true; } if (this.GetHandleYPos() <= (this.userUpArrow_mc._y + this.upArrowHeight)) { this.SetHandleYPos(this.userUpArrow_mc._y + this.upArrowHeight); bMoved = true; } if (this.bCurved) { var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (nLeftEdge != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } else { this.userHandle_mc.Owner = this; this.userHandle_mc.onEnterFrame = this.Recheck; } } return bMoved; }; GenericScrollClass.prototype.FindBarEdge = function(YPos) { var nResult = -123456; var bFound = false; var leftSide = this.userBar_mc._x; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (!bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (bFound) { offset-=increment; nResult = (leftSide + offset); } return nResult; } GenericScrollClass.prototype.FindBarRightEdge = function(YPos,XStart) { var nResult = -123456; var bFound = true; var leftSide = XStart; var rightSide = this.userBar_mc._x + this.userBar_mc._width; var increment = .49; var offset = 0; while (bFound && (leftSide + offset)<=rightSide) { bFound = this.userBar_mc.hitTest(leftSide+offset,YPos,true); offset+=increment; } if (!bFound) { offset-=increment; nResult = (leftSide + offset); } else { nResult = 1; } return nResult; } GenericScrollClass.prototype.Recheck = function() { this.onEnterFrame = undefined; this = this.Owner; var YPos = this.GetHandleYPos() + (this.GetHandleHeight()/2); var nLeftEdge = this.FindBarEdge(YPos) if (newXPos != -123456) { var nRightEdge = this.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2) - (this.origHandleWidth / 2); this.SetHandleXPos(newXPos); } } GenericScrollClass.prototype.MoveHandle = function (dx,dy) { this.userHandle_mc._x +=dx; this.SetHandleYPos(this.GetHandleYPos() + dy); this.MakeHandleInBar(); PositionChanged(); }; /////////////////////////////////////////////////////////////////////////// // // Functions to control the handles Y position and height // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.SetHandleYPos = function (yPos) { this.userTop_mc._y = yPos; this.userHandle_mc._y = (yPos+this.userTop_mc._height) - this.topOverlap; this.userBottom_mc._y = (this.userHandle_mc._y + this.userHandle_mc._height) - this.bottomOverlap; var iconPos = this.userHandle_mc._y + (((this.iconCenterPos / this.handleHeight)*this.userHandle_mc._height)-(this.userIcon_mc._height/2)); if (iconPos < this.userHandle_mc._y) { iconPos = this.userHandle_mc._y; } this.userIcon_mc._y = iconPos; }; GenericScrollClass.prototype.SetHandleXPos = function (xPos) { this.userTop_mc._x = xPos; this.userHandle_mc._x = xPos; this.userBottom_mc._x = xPos; this.userIcon_mc._x = xPos + this.relIconXPos; } GenericScrollClass.prototype.GetHandleYPos = function () { var yPos; if (this.userTop_mc != undefined) { yPos = this.userTop_mc._y; } else { yPos = this.userHandle_mc._y; } return yPos; }; GenericScrollClass.prototype.SetHandleHeight = function (newHeight) { var newHandleHeight = newHeight - (this.userTop_mc._height + this.userBottom_mc._height); if (newHandleHeight < this.userIcon_mc._height) { newHandleHeight = this.userIcon_mc._height; } if (this.userIcon_mc == undefined && newHandleHeight < minMiddleHeight) { var heightRatio = (this.ScrollHeight / this.barHeight); newHandleHeight = minMiddleHeight * heightRatio; } this.userHandle_mc._height = newHandleHeight; }; GenericScrollClass.prototype.GetHandleHeight = function () { var handleHeight; if (this.bResizeable || this.origHandleHeight == 0) { handleHeight = this.userHandle_mc._height + this.userTop_mc._height + this.userBottom_mc._height - (this.topOverlap+this.bottomOverlap); } else { handleHeight = this.origHandleHeight; } return handleHeight; } /////////////////////////////////////////////////////////////////////////// // // Handle all of the mouse movements from the scroll handle // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.GotoDefaultUpArrowState = function () { if (this.enabled == true) { this.userUpArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userUpArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultDownArrowState = function () { if (this.enabled == true) { this.userDownArrow_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userDownArrow_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultBarState = function () { if (this.enabled == true) { this.userBar_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userBar_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.GotoDefaultHandleState = function () { if (this.enabled == true) { this.userTop_mc.gotoAndPlay("normal"); this.userBottom_mc.gotoAndPlay("normal"); this.userIcon_mc.gotoAndPlay("normal"); this.userHandle_mc.gotoAndPlay("normal"); } else if (this.bPlayDisabled) { this.userTop_mc.gotoAndPlay("disabled"); this.userBottom_mc.gotoAndPlay("disabled"); this.userIcon_mc.gotoAndPlay("disabled"); this.userHandle_mc.gotoAndPlay("disabled"); } return; }; GenericScrollClass.prototype.onHandleRollOver = function() { if (this.enabled == true && !this.bOver) { this.bOver = true; this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); this.userHandle_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onHandleRollOut = function() { if (this.enabled && !this.MouseOnHandle()) { this.bOver = false; this.GotoDefaultHandleState(); } }; GenericScrollClass.prototype.MouseOnHandle = function() { var bResult = false; if (this.userTop_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userBottom_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userIcon_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } else if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { bResult = true; } return bResult; }; GenericScrollClass.prototype.onHandlePress = function() { if (this.enabled == true) { this.dragYPos = _ymouse - this.GetHandleYPos(); this.bHandleDrag = true; Mouse.addListener(this.mouseListener); this.mouseInterval = setInterval(this.onHandleDrag,25,this); this.userHandle_mc.gotoAndPlay("down"); this.userTop_mc.gotoAndPlay("down"); this.userBottom_mc.gotoAndPlay("down"); this.userIcon_mc.gotoAndPlay("down"); } }; GenericScrollClass.prototype.onHandleDrag = function(scrollbarObj) { this = scrollbarObj; if (this.bHandleDrag) { var yPos = _ymouse - this.dragYPos; this.SetHandleYPos(yPos); this.MakeHandleInBar(); PositionChanged(); } }; GenericScrollClass.prototype.onMouseRelease = function() { if (this.bHandleDrag) { this.onHandleDrag(); clearInterval(this.mouseInterval); Mouse.removeListener(this.mouseListener); this.bHandleDrag = false; if (this.userHandle_mc.hitTest(_xmouse,_ymouse,true)) { this.userHandle_mc.gotoAndPlay("over"); this.userTop_mc.gotoAndPlay("over"); this.userBottom_mc.gotoAndPlay("over"); this.userIcon_mc.gotoAndPlay("over"); } else { this.GotoDefaultHandleState(); } } }; /////////////////////////////////////////////////////////////////////////// // // Used when the used clicks on the up or down arrow to contine scrolling // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.ContinueScroll = function(scrollbarObj) { this = scrollbarObj; if (this.bArrowPressed) { if (this.bArrowIntervalFirst) { bArrowIntervalFirst = false; clearInterval(this.ArrowInterval); this.ArrowInterval = setInterval(this.ContinueScroll,75,this); } this.MoveHandle(0,this.nArrowMoveScroll); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onUpArrowPress = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,-this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = -this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onUpArrowRelease = function() { if (this.userUpArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultUpArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onUpArrowRollOver = function() { if (this.enabled) { this.userUpArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onUpArrowRollOut = function() { if (this.enabled) { this.GotoDefaultUpArrowState(); } }; GenericScrollClass.prototype.onUpArrowDragOut = function() { if (this.enabled) { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultUpArrowState(); } }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.onDownArrowPress = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("down"); this.MoveHandle(0,this.arrowIncrement); this.bArrowPressed = true; this.nArrowMoveScroll = this.arrowIncrement; this.ArrowInterval = setInterval(this.ContinueScroll,300,this); this.bArrowIntervalFirst = true; } }; GenericScrollClass.prototype.onDownArrowRelease = function() { if (this.userDownArrow_mc.hitTest(_xmouse,_ymouse,true) && this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } else { this.GotoDefaultDownArrowState(); } this.bArrowPressed = false; clearInterval(this.ArrowInterval); }; GenericScrollClass.prototype.onDownArrowRollOver = function() { if (this.enabled) { this.userDownArrow_mc.gotoAndPlay("over"); } }; GenericScrollClass.prototype.onDownArrowRollOut = function() { if (this.enabled) { this.GotoDefaultDownArrowState(); } }; GenericScrollClass.prototype.onDownArrowDragOut = function() { if (this.bArrowPressed) { this.bArrowPressed = false; clearInterval(this.ArrowInterval); } this.GotoDefaultDownArrowState(); }; GenericScrollClass.prototype.onMouseWheel = function(wheelDelta) { this.MoveHandle(0,-(this.arrowIncrement*(wheelDelta/wheelDeltaBase))); }; GenericScrollClass.prototype.PositionScrollBar = function(yPos, SCHeight) { // Set the XPosition var newXPos = Stage.width-this.barWidth; if (!this.bCurved && !this.bVertical) { newXPos -= 5; } var deltaX = newXPos - this.userBar_mc._x; if (this.bCurved) { deltaX -= (this.downArrowWidth/2); } this.userTop_mc._x += deltaX; this.userBottom_mc._x += deltaX; this.userIcon_mc._x += deltaX; this.userUpArrow_mc._x += deltaX; this.userDownArrow_mc._x += deltaX; this.userHandle_mc._x += deltaX; this.userBar_mc._x += deltaX; this.userSpace_mc._x +=deltaX; // Set YPosition and height this.actualBar = SCHeight - (this.upArrowHeight + this.downArrowHeight); this.userUpArrow_mc._y = yPos; if (this.bCurved) { this.userBar_mc._y = 0; this.userBar_mc._height = Stage.height+5; } else { this.userBar_mc._y = yPos + this.upArrowHeight; this.userBar_mc._height = this.actualBar; this.userBar_mc.Owner = this; this.userBar_mc.onEnterFrame = this.CorrectSize; } this.userSpace_mc._y = this.userBar_mc._y; this.userSpace_mc._height = this.userBar_mc._height; this.SetBgColor(this.spaceBgColor); this.userDownArrow_mc._y = (yPos + SCHeight) - this.downArrowHeight; // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; if (this.userDownArrow_mc._y < (this.userUpArrow_mc._y+this.upArrowHeight)) { this.userDownArrow_mc._y = (this.userUpArrow_mc._y+this.upArrowHeight); } // Save the yPos and height this.ScrollYPos = yPos; this.ScrollHeight = SCHeight; // If the scrollbar is curved recheck the XPosition if (this.bCurved) { // Position Up Arrow var nLeftEdge = this.FindBarEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2)); if (nLeftEdge == -123456) { this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userUpArrow_mc._y + (this.upArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.upArrowWidth/2) this.userUpArrow_mc._x = newXPos; this.userUpArrow_mc.Owner = this; this.userUpArrow_mc.onEnterFrame = RepositionOnFail; } // Position DownArrow nLeftEdge = this.FindBarEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2)); if (nLeftEdge == -123456) { this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } else { var nRightEdge = this.FindBarRightEdge(this.userDownArrow_mc._y + (this.downArrowHeight/2),nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.downArrowWidth/2) this.userDownArrow_mc._x = newXPos; this.userDownArrow_mc.Owner = this; this.userDownArrow_mc.onEnterFrame = RepositionOnFail; } // Position Resize Bar this.PositionResizeBar() } // Create the ScrollBorder this.scrollBorder_mc.clear(); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(4,0); this.scrollBorder_mc.lineTo(4,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD2D2D2,100); this.scrollBorder_mc.moveTo(3,0); this.scrollBorder_mc.lineTo(3,Stage.height); this.scrollBorder_mc.lineStyle(1,0xD5D5D5,100); this.scrollBorder_mc.moveTo(2,0); this.scrollBorder_mc.lineTo(2,Stage.height); this.scrollBorder_mc.lineStyle(1,0xDADADA,100); this.scrollBorder_mc.moveTo(1,0); this.scrollBorder_mc.lineTo(1,Stage.height); this.scrollBorder_mc.lineStyle(1,0x999999,100); this.scrollBorder_mc.moveTo(0,0); this.scrollBorder_mc.lineTo(0,Stage.height); this.scrollBorder_mc.onPress = this.BeginResize; this.scrollBorder_mc.onRelease = this.EndResize; this.scrollBorder_mc.onReleaseOutside = this.EndResize; this.scrollBorder_mc._x = Stage.width - 5; if (!this.bCurved) { this.scrollBorder_mc.onMouseMove = this.MouseOverResize; } this.scrollBorder_mc.onRollOut = this.MouseOutResize; // Create the resize cursor this.resizeCursor_mc.clear(); this.resizeCursor_mc.lineStyle(1, 0x000000, 100); this.resizeCursor_mc.beginFill(0x000000, 100); this.resizeCursor_mc.moveTo(0, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight / 2); this.resizeCursor_mc.moveTo(resizeCursorWidth / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, 0); this.resizeCursor_mc.lineTo(resizeCursorWidth * 2 / 3, resizeCursorHeight); this.resizeCursor_mc.moveTo(resizeCursorWidth * 2 / 3, resizeCursorHeight / 2); this.resizeCursor_mc.lineTo(resizeCursorWidth, resizeCursorHeight / 2); this.resizeCursor_mc.endfill(); this.spaceBg_mc._x = this.userSpace_mc._x; this.spaceBg_mc._y = this.userSpace_mc._y; this.SizeHandle(); } GenericScrollClass.prototype.SetBgColor = function(newColor) { this.spaceBgColor = newColor; this.spaceBg_mc.clear(); this.spaceBg_mc.moveTo(0,0); this.spaceBg_mc.lineStyle(1,newColor,100); this.spaceBg_mc.beginFill(newColor,100); this.spaceBg_mc.lineTo(0,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,this.userSpace_mc._height); this.spaceBg_mc.lineTo(this.userSpace_mc._width,0); this.spaceBg_mc.lineTo(0,0); this.spaceBg_mc.endFill(); }; GenericScrollClass.prototype.CorrectSize = function() { this.onEnterFrame = undefined; this.Owner.userBar_mc._height = this.Owner.actualBar; }; function RepositionOnFail() { var YPos = this._y + (this._height/2); var nLeftEdge = this.Owner.FindBarEdge(YPos); if (nLeftEdge != -123456) { var nRightEdge = this.Owner.FindBarRightEdge(YPos,nLeftEdge) var newXPos = nLeftEdge + ((nRightEdge - nLeftEdge)/2); newXPos -= (this.origWidth/2) this._x = newXPos; } } /////////////////////////////////////////////////////////////////////////// // // Nav Pane resizing // /////////////////////////////////////////////////////////////////////////// GenericScrollClass.prototype.BeginResize = function() { if (this.Owner.bResizeVisible) { this.Owner.scrollBorder_mc._visible = true; this.Owner.resizeCursor_mc._visible = false; } else if (this.Owner.bShowResizeCursor) { this.Owner.resizeCursor_mc._visible = true; } _parent.BeginResize(_xmouse,_ymouse); this.Owner.Drag(); this.Owner.resizeListener.onMouseMove = this.Owner.Drag; this.Owner.bResizing = true; if (this.Owner.bHideCursorOnResize) { Mouse.hide(); } Mouse.addListener(this.Owner.resizeListener); } GenericScrollClass.prototype.EndResize = function() { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; Mouse.removeListener(this.Owner.resizeListener); this.Owner.bResizing = false; if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } _parent.EndResize(_xmouse,_ymouse); } GenericScrollClass.prototype.MouseOverResize = function() { // Only do something if we are not resizing if (!this.Owner.bResizing && !this.Owner.bVertical && !this.Owner.bHandleDrag && this.Owner.bShowResizeCursor) { // See if we are moving over a resize area var bHit = false; if (this.Owner.scrollBorder_mc.hitTest(_xmouse, _ymouse, true) && !this.Owner.bCurved) { bHit = true; } else { if (!this.Owner.userBar_mc.hitTest(_xmouse, _ymouse, true) && DisplayResizeCursor()) { for (var i = 0; i < this.Owner.nResizeWidth; i++) { if (this.Owner.resizeBar_array[i].hitTest(_xmouse, _ymouse, true)) { bHit = true; } } } } // Show (or don't) the resize cursor if (bHit) { if (this.Owner.bHideCursorOnResize) { Mouse.hide(); } this.Owner.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; this.Owner.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; this.Owner.resizeCursor_mc._visible = true; clearInterval(this.Owner.resizeInterval); this.Owner.resizeInterval = setInterval(this.Owner.ResizeTimeout,RESIZEBAR_TIMEOUT,this.Owner); } else { Mouse.show(); this.Owner.resizeCursor_mc._visible = false; } } } GenericScrollClass.prototype.ResizeTimeout = function(Owner) { clearInterval(Owner.resizeInterval); if (!Owner.bResizing) { Owner.resizeCursor_mc._visible = false; Mouse.show(); } } GenericScrollClass.prototype.MouseOutResize = function() { this.Owner.resizeCursor_mc._visible = false; Mouse.show(); } GenericScrollClass.prototype.Drag = function() { if (fhgeneric_comp.bResizeVisible) { fhgeneric_comp.scrollBorder_mc._x = _xmouse; } else { fhgeneric_comp.resizeCursor_mc._x = _xmouse - resizeCursorWidth / 2; fhgeneric_comp.resizeCursor_mc._y = _ymouse - resizeCursorHeight / 2; } _parent.Drag(_xmouse,_ymouse); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Scroll Handle // /////////////////////////////////////////////////////////////////////////// handle_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; handle_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; handle_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; top_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; top_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; top_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; bottom_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; bottom_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; bottom_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; icon_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onHandleRollOver(); }; icon_mc.onPress = function() { fhgeneric_comp.onHandlePress(); }; icon_mc.onRollOut = function() { fhgeneric_comp.onHandleRollOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Up Arrow // /////////////////////////////////////////////////////////////////////////// uparrow_mc.onPress = function() { fhgeneric_comp.onUpArrowPress(); }; uparrow_mc.onRelease = function() { fhgeneric_comp.onUpArrowRelease(); }; uparrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onUpArrowRollOver(); }; uparrow_mc.onRollOut = function() { fhgeneric_comp.onUpArrowRollOut(); }; uparrow_mc.onDragOut = function() { fhgeneric_comp.onUpArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for the Down Arrow // /////////////////////////////////////////////////////////////////////////// downarrow_mc.onPress = function() { fhgeneric_comp.onDownArrowPress(); }; downarrow_mc.onRelease = function() { fhgeneric_comp.onDownArrowRelease(); }; downarrow_mc.onRollOver = function() { this.useHandCursor = false; fhgeneric_comp.onDownArrowRollOver(); }; downarrow_mc.onRollOut = function() { fhgeneric_comp.onDownArrowRollOut(); }; downarrow_mc.onDragOut = function() { fhgeneric_comp.onDownArrowDragOut(); }; /////////////////////////////////////////////////////////////////////////// // // Handle mouse messages for ScrollBar // /////////////////////////////////////////////////////////////////////////// bar_mc.onPress = function() { fhgeneric_comp.onBarPress(); }; bar_mc.onRollOver = function() { this.useHandCursor = false; } /////////////////////////////////////////////////////////////////////////// // // Handle mouse wheel messages // /////////////////////////////////////////////////////////////////////////// function OnMouseWheel(wheelDelta) { if (_ymouse >= fhgeneric_comp.ScrollYPos && _ymouse <= (fhgeneric_comp.ScrollYPos + fhgeneric_comp.ScrollHeight)) { fhgeneric_comp.onMouseWheel(wheelDelta); } else { var i = 0; for (i=0; i< miniScroll_array.length;i++) { if (_ymouse>=miniScroll_array[i].ScrollYPos && _ymouse <= miniScroll_array[i].ScrollYPos+miniScroll_array[i].ScrollHeight) { miniScroll_array[i].scrollbar.onMouseWheel(wheelDelta); } } } } function DisplayResizeCursor() { var bResult = true; if ((fhgeneric_comp.userHandle_mc.hitTest(_xmouse, _ymouse, true) || fhgeneric_comp.userUpArrow_mc.hitTest(_xmouse, _ymouse, true) || fhgeneric_comp.userDownArrow_mc.hitTest(_xmouse, _ymouse, true)) && fhgeneric_comp.enabled) { bResult = false; } for (var i =0; i < miniScroll_array.length; i++) { if ((miniScroll_array[i].scrollbar.userHandle_mc.hitTest(_xmouse, _ymouse, true) || miniScroll_array[i].scrollbar.userUpArrow_mc.hitTest(_xmouse, _ymouse, true) || miniScroll_array[i].scrollbar.userDownArrow_mc.hitTest(_xmouse, _ymouse, true)) && miniScroll_array[i].scrollbar.enabled) { bResult = false; } } return bResult; } // Register the class Object.registerClass("FGenericFHScroll", GenericScrollClass); #endinitclip€€ Main Scroll ActionsџџџџO€џџ€€€€џџџ?џџџН#initclip var debug_trace = _parent.debug_trace; var currentItem = undefined; function PositionChanged() { // Get the scrollbar height barHeight = fhgeneric_comp.actualBar; // Get the thumb height thumbHeight = fhgeneric_comp.GetHandleHeight(); // Get the total scrolling distance - take into account the up and down arrows and height of the thumb realBarHeight = barHeight - thumbHeight; // Get the thumbposition on the total scrolling area - adjust for uparrow realPos = fhgeneric_comp.GetHandleYPos() - (fhgeneric_comp.userUpArrow_mc._y + fhgeneric_comp.upArrowHeight); // Save the current posiiton for when the scrollbar is resized fhgeneric_comp.realPosition = ((realPos / realBarHeight)*(fhgeneric_comp.maxScroll - fhgeneric_comp.ScrollHeight)); // Check for .00001 instead of 0 because flash loses significant digits on some obscure browsers if (realBarHeight <= .00001 || fhgeneric_comp.realPosition < 0 || !fhgeneric_comp.enabled) { fhgeneric_comp.realPosition=0; realPos = 0; } // Send the command to the NavHost if (currentItem == _parent.curScrollItem.pfnScroll || currentItem == undefined) { _parent.curScrollItem.pfnScroll(fhgeneric_comp.realPosition); } } #endinitclip€€ Scrollbar to OwnerџџџџOџџџ€€ ˆАˆАŒАŒАŒАŒ@Œ@Œ)Œ)ŒАŒАŒ T T)T)T@Œ@Œ Œ Œџџџ?џџ=.€€ Layer 1џџџџO€џџ€€{гџџџnЂџџџЯ ўџџџ џџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSprite dџџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSym      !"#$ўџџџ'џџџџ()*D,-./0123456789:;<=>E@ABCLFGHIRKўџџџMNOPQЭETUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€bol`џџџ`џџџ ^ђ^ђ`џџџ`џџџdџ€џџџџ џЂўџџЂўџџџџџџџџџ€€џџџ?џџ=]€€ Layer 1џџџџO€џџ€€џџ?џџnormalr:џ&Nzspace_mc€€џџџ?џџ /€€ WhitespaceџџџџџOOџ€€€ Гўdџіbar_mc€€џџџ?џџ2+€€ Barџџџџ™3Ьџ€€€tџџџ` tџџџ` dџ&S handle_mc€xШ xШџџџџ:ыKfhgeneric_compthumbResizeabletrue bResizeableкГО}€oSL„јМт|љМscrollbarCurvedtruebCurved6L@ЦdцEŠFA7nM‚О€€џџџ?џџ€€ џџџ?џџoverP€€€џџџ?џџdownk:€€€ џџџ?џџdisabled[€€€џџџ?џџж€€ LabelsџџџџOџOџ€€џџџ?џџ@Зd€€ HandleџџџџџOџџ€€€€џџџ?џџЈ €€ IconџџџџO€џџ€€€€џџџ?џџ4џџCPicPageџџ CPicLayerџџ CPicFrame€€ ƒ–ВџћЎИџЄџџ.ЧЖўВ<џЄџ<b ъ88х–їж€M8zКџџ‘+џџџћ<џ^љџќя<žіъњя8 G}ќ§џ@dњЛ№ѕџџдўџџ№ѕџџдўџџ іџџдўџџ іџџдўџџ іџџt іџџt№ѕџџt№ѕџџt іџџдўџџ іџџдўџџ іџџt іџџt№ѕџџt№ѕџџt№ѕџџдўџџ№ѕџџдўџџџџџ?џџз0€€ FGџџџџO€џџ€€€€ TopџџџџџџOџ€€€€џџџ?џџРe€€ BottomџџџџOџџџ€€€xP xPdџ4s downarrow_mc€Œ ŒdџЉ uparrow_mc€€џџџ?џџр"€€ ArrowџџџџOџOџ€€€€џџџ?џџ2X€€ Componentџџџџ€€€џ€€ ЄЃЅІЇХЉгЋЌ­ЎЏАџџCPicPageџџ CPicLayerџџ CPicFrameџџ CPicSymbolC$ ЛєџC$џџџџ€€џџџ?џџ’"€€ Bar PlaceholderџџџџOџOџ€€)џџ CDocumentPagePage 1Scene 1ХУІ> џџџџѕЧT?џџџџ€ Symbol 38 whitespace&яњП>Џ Symbol 38џџџџ,?џџџџ€ Symbol 35UpDownPointers#ЧѓП> Symbol 35џџџџŸєП>џџџџ€ Symbol 25BarЮА>ю Symbol 25џџџџm?џџџџ€ Symbol 24Tween 1ЎЬА>лџџџџRPЭ>џџџџ€ Symbol 21Icon PlaceholderŽJА>X Symbol 21џџџџCЯА>џџџџ€ Symbol 13Bar Placeholder ђм­>† Symbol 13џџџџъ!Џ>џџџџ€Symbol 7Arrow PlaceholderЯy­>Symbol 7џџџџS!Џ>џџџџ€Symbol 6Handle Top Bottom Placeholderœ}­>$Symbol 6џџџџЗаА>џџџџ€Symbol 9Handle Placeholder  }­>%,Placeholder Graphics/Handle Placeholder copyџџџџУаА>џџџџ€Symbol 5Handle }­> Symbol 5џџџџU^?џџџџ€Symbol 3 DownArrowBalldЬА>йSymbol 3џџџџ^?џџџџ€ Symbol 26 UpArrowBall€вА>DownArrowBall copyџџџџУ]?џџџџ€ Symbol 18 DownArrow†Џ>џ UpArrow copyџџџџ #Џ>џџџџ€Symbol 8 HandleTopё|­>MovieHandle copyџџџџСђП>џџџџ€ Symbol 20IconƒJА>VHandleTop copyџџџџтбА>џџџџ€ Symbol 17 HandleBottomбЏ>ђHandleTop copyџџџџmбА>џџџџ€Symbol 2MovieBar:ФІ>Symbol 2џџџџ§+?џџџџ€ Symbol 22BallЬА>и..\orange\navpane.fla AJ/Tween 1Џ Ž>zБ>ћ#?џџџџ€ Symbol 23pointer0?>7..\orange\navpane.fla AJ/pointeršЏ>0?>7Эю>џџџџ€ Symbol 45HotSpot-<ІИ>Б.\skin_button_nav_next.flaHotSpot<ІИ><ІИ>Б<ІИ>џџџџ€ Symbol 46sync.ЋЧА>Ј.\skin_button_nav_next.flasync*ўэ>ЋЧА>Јю>џџџџ€ Symbol 47 Button BG/уФА>™.\skin_button_nav_next.fla Button BGгњэ>уФА>™!?џџџџ€ Symbol 48search0%$—>U.\skin_button_nav_next.flasearchбњэ>%$—>Uбњэ>џџџџ€ Symbol 58Generic FH Scroll Component:]OИ>gFGenericFHScrollflashhelp_components.swf+C:\FlashComponents\FlashHelp_Components.flaGeneric FH Scroll Component—8M?џџџџ—8M?thumbResizeabletrue bResizeableкГО}€oSL„јМт|љМscrollbarCurvedfalsebCurved6L@ЦdцEŠFA7nM‚Оџџџџ;џџ CMediaBitsMedia 1bt.png*..\..\..\..\..\..\..\..\..\jonathan\bt.pngC <р—> џџџџ2аpШhhhhџџџџРРРџ Дz%PublishFormatProperties::htmlFileNametestskin_scrollbar.html"PublishHtmlProperties::StartPaused0!PublishGifProperties::PaletteName PublishRNWKProperties::speed256K0PublishFormatProperties::jpeg0Vector::Debugging Permitted0PublishHtmlProperties::Loop1"PublishQTProperties::MatchMovieDim1 PublishQTProperties::AlphaOption PublishQTProperties::LayerOptionPublishHtmlProperties::Units0$PublishPNGProperties::OptimizeColors1PublishQTProperties::Width15&PublishRNWKProperties::singleRateAudio0&PublishRNWKProperties::speedSingleISDN0%PublishFormatProperties::projectorMac0&PublishFormatProperties::flashFileNametestskin_scrollbar.swfVector::Compress Movie1PublishGifProperties::Smooth1#PublishRNWKProperties::flashBitRate1200%PublishRNWKProperties::mediaCopyright(c) 2000PublishFormatProperties::html0$PublishFormatProperties::pngFileNametestskin_scrollbar.png(PublishHtmlProperties::VerticalAlignment1PublishHtmlProperties::Quality4"PublishGifProperties::DitherOption"PublishRNWKProperties::exportAudio1 PublishRNWKProperties::speed384K0!PublishRNWKProperties::exportSMIL1Vector::Override Sounds0!PublishHtmlProperties::DeviceFont0"PublishPNGProperties::FilterOption'PublishRNWKProperties::mediaDescriptionPublishFormatProperties::gif0*PublishFormatProperties::generatorFileNametestskin_scrollbar.swtVector::Template0Vector::Protect0Vector::Quality80*PublishHtmlProperties::HorizontalAlignment1"PublishHtmlProperties::DisplayMenu1PublishGifProperties::Interlace0"PublishGifProperties::DitherSolids0PublishPNGProperties::Smooth1PublishPNGProperties::BitDepth24-bit with AlphaPublishJpegProperties::DPI4718592PublishQTProperties::Flatten1#PublishFormatProperties::qtFileNametestskin_scrollbar.movPublishGifProperties::Width15PublishGifProperties::Loop1PublishRNWKProperties::speed28K1!PublishRNWKProperties::mediaTitle$PublishRNWKProperties::mediaKeywordsPublishFormatProperties::flash1#PublishGifProperties::MatchMovieDim1#PublishGifProperties::PaletteOption"PublishPNGProperties::DitherOptionPublishJpegProperties::Quality80$PublishRNWKProperties::realVideoRate100000$PublishRNWKProperties::speedDualISDN0-PublishFormatProperties::projectorWinFileNametestskin_scrollbar.exePublishHtmlProperties::Align0#PublishPNGProperties::MatchMovieDim1#PublishPNGProperties::PaletteOption$PublishJpegProperties::MatchMovieDim1%PublishFormatProperties::jpegFileNametestskin_scrollbar.jpgVector::Omit Trace Actions0Vector::Debugging PasswordPublishHtmlProperties::Width15PublishHtmlProperties::Height250"PublishPNGProperties::DitherSolids0"PublishJpegProperties::Progressive0#PublishQTProperties::PlayEveryFrame0PublishFormatProperties::png0PublishFormatProperties::rnwk0-PublishFormatProperties::projectorMacFileNametestskin_scrollbar.hqxVector::TopDown0!PublishHtmlProperties::WindowMode0'PublishHtmlProperties::TemplateFileNamegC:\Documents and Settings\RLinyard\Application Data\Macromedia\Flash MX\Configuration\Html\Default.htmlPublishGifProperties::Height250PublishPNGProperties::Interlace0PublishJpegProperties::Size0"PublishFormatProperties::generator0Vector::Report0PublishGifProperties::LoopCount'PublishGifProperties::TransparentOptionPublishGifProperties::MaxColors255%PublishPNGProperties::RemoveGradients0PublishQTProperties::Height250PublishRNWKProperties::speed56K1PublishFormatProperties::qt0Vector::Stream Compress7Vector::Event Format0Vector::Version6$PublishGifProperties::OptimizeColors1"PublishRNWKProperties::audioFormat0Vector::Event Compress7PublishHtmlProperties::Scale0%PublishGifProperties::RemoveGradients0PublishPNGProperties::Width15PublishPNGProperties::Height250PublishJpegProperties::Height250 PublishRNWKProperties::speed512K0$PublishFormatProperties::gifFileNametestskin_scrollbar.gifVector::Stream Format0PublishGifProperties::Animated0&PublishGifProperties::TransparentAlpha128!PublishPNGProperties::Transparent0!PublishPNGProperties::PaletteNamePublishJpegProperties::Width15*PublishQTProperties::UseQTSoundCompression0PublishQTProperties::Looping0"PublishRNWKProperties::exportFlash1&PublishRNWKProperties::showBitrateDlog1(PublishRNWKProperties::speedCorporateLAN0"PublishRNWKProperties::mediaAuthor%PublishFormatProperties::defaultNames1%PublishFormatProperties::projectorWin0%PublishFormatProperties::rnwkFileNametestskin_scrollbar.smilPublishPNGProperties::MaxColors255%PublishQTProperties::ControllerOption0"PublishQTProperties::PausedAtStart0PropSheet::ActiveTab1599џџџџ§џџ CColorDefџ€џ€џ€3џPя€fџPя0€™џPяH€ЬџPя`€џџPяx€3џя€33џ(я€3fџ<я0€3™џCяH€3ЬџFя`€3џџHяx€fџя0€f3џя0€ffџ(я0€f™џ5яH€fЬџ<я`€fџџ@яx€џ€333џ0€џ€3џ я€33џxя€f3џdя0€™3џ]яH€Ь3џZя`€џ3џXяx€33џШя€333џ0€3f3џPPH€3™3џPx`€3Ь3џPx€3џ3џPя€f3џмя0€f33џPH€ff3џ(PH€f™3џ<x`€fЬ3џCx€fџ3џFя€џ€fffџ`€џ€fџ я0€3fџŒя0€ffџxя0€™fџkяH€Ьfџdя`€џfџ`яx€3fџДя0€33fџ PH€3ffџxPH€3™fџdx`€3Ьfџ]x€3џfџZя€ffџШя0€f3fџШPH€fffџ`€f™fџP0x€fЬfџPx€fџfџPяЈ€џ€™™™џ€џ€™џ яH€3™џ“яH€f™џ…яH€™™џxяH€Ь™џnя`€џ™џhяx€3™џ­яH€33™џ x`€3f™џŒx`€3™™џxx`€3Ь™џkx€3џ™џdя€f™џЛяH€f3™џДx`€ff™џ 0x€f™™џx0x€fЬ™џdx€fџ™џ]яЈ€џ€ЬЬЬџР€џ€Ьџ я`€3Ьџ–я`€fЬџŒя`€™Ьџ‚я`€ЬЬџxя`€џЬџpяx€3ЬџЊя`€33Ьџ x€3fЬџ“x€3™Ьџ…x€3ЬЬџxx€3џЬџnя€fЬџДя`€f3Ьџ­x€ffЬџ x€f™ЬџŒx€fЬЬџxx€fџЬџkяЈ€џ€џџџџ№€џ€џџ яx€3џџ˜яx€fџџяx€™џџˆяx€Ьџџ€яx€џџџxяx€3џџЈяx€33џџ я€3fџџ–я€3™џџŒя€3Ьџџ‚я€3џџџxя€fџџАяx€f3џџЊя€ffџџ яЈ€f™џџ“яЈ€fЬџџ…яЈ€fџџџxяЈ€џ€џџяx€џ€™џяH€™3џ яH€™fџяH€™™џ(яH€™Ьџ2я`€™џџ8яx€Ьџя`€Ь3џ я`€Ьfџя`€Ь™џя`€ЬЬџ(я`€Ьџџ0яx€џџяx€џ3џяx€џfџяx€џ™џяx€џЬџ яx€џџџ(яx€џ€џџPяx€џ€™3џуяH€™33џx`€™f3џx`€™™3џ(x`€™Ь3џ5x€™џ3џ<я€Ь3џця`€Ь33џx€Ьf3џ x€Ь™3џx€ЬЬ3џ(x€Ьџ3џ2я€џ3џшяx€џ33џя€џf3џ я€џ™3џя€џЬ3џя€џџ3џ(я€џ€џџ яx€џ€™fџеяH€™3fџмx`€™ffџ0x€™™fџ(0x€™Ьfџ<x€™џfџCяЈ€Ьfџмя`€Ь3fџуx€Ьffџx€Ь™fџx€ЬЬfџ(x€Ьџfџ5яЈ€џfџряx€џ3fџця€џffџяЈ€џ™fџ яЈ€џЬfџяЈ€џџfџ(яЈ€џ€џџџ(яx€џ€™™џШяH€™3™џШx`€™f™џШ0x€™™™џ€™Ь™џPPЈ€™џ™џPяР€Ь™џвя`€Ь3™џеx€Ьf™џмx€Ь™™џPЈ€ЬЬ™џ(PЈ€Ьџ™џ<яР€џ™џияx€џ3™џмя€џf™џуяЈ€џ™™џяР€џЬ™џяР€џџ™џ(яР€џ€џџџxяx€џ€™ЬџОя`€™3ЬџЛx€™fЬџДx€™™Ьџ PЈ€™ЬЬџxPЈ€™џЬџdяР€ЬЬџШя`€Ь3ЬџШx€ЬfЬџШx€Ь™ЬџШPЈ€ЬЬЬџР€ЬџЬџPяи€џЬџаяx€џ3Ьџвя€џfЬџеяЈ€џ™ЬџмяР€џЬЬџяи€џџЬџ(яи€џ€џџџШяx€џ€™џџИяx€™3џџДя€™fџџ­яЈ€™™џџ яР€™ЬџџŒяР€™џџџxяР€ЬџџРяx€Ь3џџОя€ЬfџџЛяЈ€Ь™џџДяР€ЬЬџџ яи€Ьџџџxяи€џџџШяx€џ3џџШя€џfџџШяЈ€џ™џџШяР€џЬџџШяи€џџџџ№€џ€d…žџŠ8z€џџџџџџџ€џџџџџџџ€џџџџџ€џџџџџ€џџџџџ яx€џf§џ`џџџџzџџџџ€™fџЊџЬџџџџџџ€џџџ*џџџ]џџџџџЊџџдџџџџџџqk'€Placeholder Graphicsџџџџ"PublishQTProperties::QTSndSettingsџџCQTAudioSettingsџџШ