# Adjustin FullScreenScrollBar

**URL:** <https://forum.kirupa.com/t/adjustin-fullscreenscrollbar/289868>\
**Category:** flash\
**Created:** [June 5, 2009, 9:03pm UTC](https://forum.kirupa.com/t/adjustin-fullscreenscrollbar/289868 "2009-06-05T21:03:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![youwh](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@youwh](https://forum.kirupa.com/u/youwh)\
**Post date:** [June 5, 2009, 9:03pm UTC](https://forum.kirupa.com/t/adjustin-fullscreenscrollbar/289868/1 "2009-06-05T21:03:20Z")

</div>

I am trying to control the size of the scroll bar from another class and I tried every way i could think of but still fails. I think its because i am not calling the class the correct way. Could anyone kind enough to show me what’s wrong with my script? Thanx!

The class that calls the scrollbar

```auto

package {
    import flash.display.*;
    import flash.events.*;

    import gs.*;
    import fl.motion.easing.*;

    public class scrollBar extends Sprite {
        public var fullScroll:FullScreenScrollBar;

        public function scrollBar() {
            addEventListener(Event.ADDED_TO_STAGE,onAddedToStage);
        }

        private function onAddedToStage(event:Event):void {
            removeEventListener(Event.ADDED_TO_STAGE,onAddedToStage);
            init();
        }

        private function init():void {
             var loadIn:loading=new loading ;
            addChild(loadIn);

            fullScroll=new FullScreenScrollBar(loadIn,0x222222,0x333333,0xCC0000,0xffffff,15,15,4,true);
            addChild(fullScroll);

        }
    }
}

```

The class the activate the resize of the scrollbar

```auto

package {
    import flash.display.*;
    import flash.events.Event;

    import gs.*;
    import fl.motion.easing.*;

    public class loading extends Sprite {
        public var scrollB:scrollBar=new scrollBar;
        
        public var fullScroll:FullScreenScrollBar;

        public function loading():void {
            addEventListener(Event.ADDED_TO_STAGE,onAddedToStage);
        }

        private function onAddedToStage(event:Event):void {

            trace(scrollB.fullScroll.height);
            stage.addEventListener(Event.RESIZE,stageResize);
            stage.dispatchEvent(new Event(Event.RESIZE));

        }
        private function stageResize(event:Event=null):void {
            
  **scrollB.fullScroll.adjustSize()**
        }
    }
}

```

Here’s the error that i get

TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at MethodInfo-103()  
at Function/[http://adobe.com/AS3/2006/builtin::apply()](http://adobe.com/AS3/2006/builtin::apply())  
at gs::TweenLite/complete()  
at gs::TweenLite/render()  
at gs::TweenLite$/updateAll()
