dcsimg
A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: scrollbox just out?

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Nottingham, England
    Posts
    263

    scrollbox just out?

    Hi,

    anyone know what's happened to my scrollbox? - ive made a content box with 8 buttons attached to it and i'm using a scroller to scroll through them. for some reason the code isnt making the content scroll to the very bottom - seem s to be about 5 pixels out.

    the code seems fine - anyone any ideas? i've attached the swf (content box is organe and the mask is green) - as you can see the contents box just misses the bottom of the mask?

    here's the code (large parts deleted to keep it small) -

    PHP Code:
            private var masker:MovieClip;
            private var 
    Content:MovieClip;
            private var 
    scrollBar:MovieClip;
            private var 
    thumb:MovieClip;
            private var 
    yOffset:Number;
            private var 
    yMin:Number 155;
            
            

            public function 
    menu_1() {

                
    init();

            }
            private function 
    init():void {
                
                
    masker = new Masker;
                
    addChild(masker);
                
                
    Content = new Container;
                
    addChild(Content);
                
                
    scrollBar = new Scrollbar;
                
    addChild(scrollBar);
                
                
    thumb = new Thumb;
                
    addChild(thumb);

                
    //sampleBtns
                

                
    this.addEventListener(Event.ADDED_TO_STAGE,stageActive);
            }
            function 
    stageActive(evt:Event):void {

                
    stage.scaleMode StageScaleMode.NO_SCALE;
                
    stage.align StageAlign.TOP_LEFT;
                
    stage.addEventListener(Event.RESIZE,resizeHandler);
                

                
    masker.105;
                
    masker.150;
                
                
    Content.105;
                
    Content.150;
                
                
    //Content.mask = masker;
                
                
    scrollBar.415;
                
    scrollBar.155;
                
                
    thumb.415;
                
    thumb.155;

                
    //sampleBtns positions

                //intro / outro positions

                
                
    thumb.addEventListener(MouseEvent.MOUSE_DOWNthumbDown);
                
    stage.addEventListener(MouseEvent.MOUSE_UPthumbUp);
                
    this.addEventListener(Event.ENTER_FRAMEonEnterframe);
            }

            
            
            private function 
    thumbDown(e:MouseEvent):void{
                
            
    stage.addEventListener(MouseEvent.MOUSE_MOVEthumbMove);
            
    yOffset mouseY thumb.y;
            
            }

            private function 
    thumbUp(e:MouseEvent):void{
                
            
    stage.removeEventListener(MouseEvent.MOUSE_MOVEthumbMove);
            }
            
            private function 
    thumbMove(e:MouseEvent):void{
                
            var 
    yMax:Number = (scrollBar.height thumb.height) +155;
                
            
    thumb.mouseY yOffset;
            
                if(
    thumb.<= yMin)
                    
    thumb.yMin;
                
                if(
    thumb.>= yMax)
                    
    thumb.yMax;
                    
            var 
    sp:Number thumb.yMax;

        
    TweenMax.to(Content1, {y:(-sp*(Content.height masker.height)+305)});
        
    e.updateAfterEvent();

    thanks
    Last edited by inquizard; 11-24-2008 at 01:33 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center