# LiquidArea and DynamicPinPoint

**URL:** <https://forum.kirupa.com/t/liquidarea-and-dynamicpinpoint/312169>\
**Category:** flash\
**Created:** [July 27, 2010, 10:47am UTC](https://forum.kirupa.com/t/liquidarea-and-dynamicpinpoint/312169 "2010-07-27T10:47:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thehat](https://avatars.discourse-cdn.com/v4/letter/t/ea5d25/32.png) [@thehat](https://forum.kirupa.com/u/thehat)\
**Post date:** [July 27, 2010, 10:47am UTC](https://forum.kirupa.com/t/liquidarea-and-dynamicpinpoint/312169/1 "2010-07-27T10:47:30Z")

</div>

Has anyone used these two in conjunction before? On his forum, Greensock told me to give this a try, but I’m obviously not getting something

The constructor:

```auto

public function ScreenshotLargeDisplay():void
{
    ls = LiquidStage.defaultStage;
    la = new LiquidArea(this,(0-(applicationSettings.BASESIZEWIDTH/2))+_margin,_margin,applicationSettings.BASESIZEWIDTH-(_margin*2),applicationSettings.BASESIZEHEIGHT-(_margin*2),0xFF0000,applicationSettings.BASESIZEWIDTH-(_margin*2),applicationSettings.BASESIZEHEIGHT-(_margin*2),_maxScreenWidth,_maxScreenHeight,false);
    la.pinCorners(new DynamicPinPoint(this,getTopLeft), new DynamicPinPoint(this,getBottomRight));
    la.preview = true;
}

```

The functions to return the points:

```auto

protected function getTopLeft():Point
{
    var temp:Point = new Point(0,_margin);
    if(ls.stageBox.width > _maxScreenWidth+(_margin*2)) {
        //handle oversize screen
    } else {
        temp.x = (0-(applicationSettings.BASESIZEWIDTH/2))+_margin;
    }
    return temp;
}
        
protected function getBottomRight():Point
{
    var temp:Point = new Point(0,_maxScreenHeight+(_margin*2));
    if(ls.stageBox.width > _maxScreenWidth+(_margin*2)) {
        //handle oversize screen
    } else {
        temp.x = applicationSettings.BASESIZEWIDTH/2;
    }
    return temp;
}

```

Currently all I get is an error from inside the LiquidArea class, so obviously my points aren’t returning everything it wants. I’ve read the documentation though, and I’m not sure what I’m missing.

> TypeError: Error #1009: Cannot access a property or method of a null object reference.  
> at com.greensock.layout::LiquidArea/pinCorners()  
> at com.biff.components.screenshots.v2::ScreenshotLargeDisplay()

[http://www.greensock.com/as/docs/tween/com/greensock/layout/DynamicPinPoint.html](http://www.greensock.com/as/docs/tween/com/greensock/layout/DynamicPinPoint.html)
