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:
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:
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