0 Replies Latest reply on Aug 30, 2007 7:52 AM by mjlash

    scroll bar actions script issue

    mjlash
      I am having a problem with the action script for a scroll bar the code is complex and I did not write it but have managed to make other adjustments to get it to work...think we got the wrong raw file to work from because the scroll bar works in the file on the seller's server. Can't find the programmer now. If someone could please tell me what I am missing. The scroll bar works if you use the solid scroller in the middle but does not move the information and the arrows do not work at all. You can check this out at http://74.53.228.34/~jacob753/vocab/
      Just click on crossword and then load a topic and you will see that the scroll bar does not work at all. The floating window is another issue and I will put this in another message after this is fixed.
      The code is below:

      initClueListScroll = function(y){
      // y : hauteur de la cluelist (height of the cluelist)
      _global.clueListHeight = y
      _global.clueListScroll = true
      var c = clScrollClip
      c._x = Math.floor(cluelistClip._x+cluelistClip._width)
      c.scrollBG._height = gridSize*cellSize-40
      c.scrdownClip._y = c.scrollBG._y+c.scrollBG._height
      c.scroller._height = c.scrollBG._height*(gridSize*cellSize/y)
      // ---- on définit les actions (action definitions)
      c.scrdownClip.onRollOver = c.scrupClip.onRollOver = function(){
      this.gotoAndPlay(2)
      }
      c.scrdownClip.onRollOut = c.scrupClip.onRollOut = function(){
      this.gotoAndStop(1)
      }
      c.scrdownClip.onReleaseOutside = c.scrdownClip.onRelease = function(){
      this.gotoAndStop(1)
      var c = getMain().clScrollClip
      c.scrollBG.onRelease()
      }
      c.scrupClip.onReleaseOutside = c.scrdownClip.onRelease = function(){
      this.gotoAndStop(1)
      var c = getMain().clScrollClip
      c.scrollBG.onRelease()
      }
      c.scroller.onRollOver = function(){
      this.gotoAndStop(2)
      }
      c.scroller.onRollOut = function(){
      this.gotoAndStop(1)
      }
      c.scroller.onPress = function(){
      this.gotoAndStop(2)
      var c = getMain().clScrollClip
      var yMin = c.scrollBG._y
      var yMax = c.scrollBG._y+Math.floor(c.scrollBG._height-c.scroller._height)
      this.startDrag(false,0,yMin,0,yMax)
      getMain().onMouseMove = function(){
      var c = getMain().clScrollClip
      var yDes = c.scroller._y-20
      var yMax = Math.floor(c.scrollBG._height-c.scroller._height)
      var yFin = 20+Math.min(yDes,yMax)
      c.scroller.setGoTo(c.scroller._x,yFin,100,c.scroller._yscale,100,0,4)
      var yDiff = (yFin-c.scrollBG._y)*(gridSize*cellSize/c.scrollBG._height)
      if(yFin==yMax+20){
      var ymn = 0
      var ymx = clueListHeight-(gridSize*cellSize)
      yDiff = (ymx - ymn)*(yFin/(yMax+20))
      }
      // pX, pY, pW, pH, pA, pR, pSpeed
      var cl = getMain().cluelistClip.contClip
      cl.setGoTo(cl._x,-yDiff+gridPosition.y,100,100,100,0,4)
      }
      }
      c.scroller.onRelease = c.scroller.onReleaseOutside = function(){
      stopDrag()
      this.gotoAndStop(1)
      delete getMain().onMouseMove
      }
      c.scrollBG.onRelease = function(){
      var c = getMain().clScrollClip
      var yDes = c._ymouse-20<c.scroller._height ? 0 : c._ymouse-20
      var yMax = Math.floor(c.scrollBG._height-c.scroller._height)
      var yFin = 20+Math.min(yDes,yMax)
      c.scroller.setGoTo(c.scroller._x,yFin,100,c.scroller._yscale,100,0,4)
      var yDiff = (yFin-c.scrollBG._y)*(gridSize*cellSize/c.scrollBG._height)
      if(yFin==yMax+20){
      var ymn = 0
      var ymx = clueListHeight-(gridSize*cellSize)
      yDiff = (ymx - ymn)*(yFin/(yMax+20))
      }
      // pX, pY, pW, pH, pA, pR, pSpeed
      var cl = getMain().cluelistClip.contClip
      cl.setGoTo(cl._x,-yDiff+gridPosition.y,100,100,100,0,4)
      }
      c.scrollBG.onReleaseOutside = c.scrollBG.onRelease
      }
      //