# Another stage question

**URL:** <https://forum.kirupa.com/t/another-stage-question/259441>\
**Category:** flash\
**Created:** [May 5, 2008, 1:46pm UTC](https://forum.kirupa.com/t/another-stage-question/259441 "2008-05-05T13:46:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![halian](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@halian](https://forum.kirupa.com/u/halian)\
**Post date:** [May 5, 2008, 1:46pm UTC](https://forum.kirupa.com/t/another-stage-question/259441/1 "2008-05-05T13:46:02Z")

</div>

I’m still not understanding how to access the stage within a class.

basically all I want to do is get the midpoint with stageWidth and stageHeight but I keep getting this error:

Cannot access a property or method of a null object reference.

code as it stands:

```auto
package com.mysite.mouse{
    //imports
    import flash.display.MovieClip;
    import flash.display.Stage;
    import flash.events.MouseEvent;
    import flash.geom.Point;

    //class
    public class ZoomToPoint extends MovieClip {
        //variables
        private var clip:MovieClip;
        private var scp:Point;
        //constructor
        public function ZoomToPoint($clip:MovieClip) {

            clip = $clip;
            clip.buttonMode = true;

            clip.addEventListener(MouseEvent.CLICK, clickHandle);

        }
        //handler
        private function clickHandle(evt:MouseEvent):void {

            scp = new Point(stage.stageWidth/2,stage.stageHeight/2);
        }
    }
}

```
