Stage height and width in private const or variable
Hello, everyone I've got problem with this code.
I need stage size in const or variable because of some resize reasons.
ok so, code below works but it's static and I need dynamicaly get stage size.
private const LIST_HEIGHT :uint = 800;
private const LIST_WIDTH :uint = 1200;
with(_mask)
{
graphics.beginFill(0);
graphics.drawrect(0, 0, LIST_WIDTH, LIST_HEIGHT);
graphics.endFill();
}
and if I change constants to this:
private const LIST_HEIGHT :uint = stage.stageHeight;
private const LIST_WIDTH :uint = stage.stageWidth;
it's not work
also this not work
private var _listH :uint = stage.stageHeight;
private var _listW :uint = stage.stageWidth;
and this:
private var _listH :String = stage.stageHeight;
private var _listW :String = stage.stageWidth;
not work means that I get this error
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.filebrowser::FilesList()[/Users/Peter/Desktop/projectfl/projectfl beta 0.6/as3/com/filebrowser/FilesList.as:14]
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at com.filebrowser::FileBrowser()[/Users/Peter/Desktop/projectfl/projectfl beta 0.6/as3/com/filebrowser/FileBrowser.as:51]
Thanks in advance for all replies, all help is very appreciated. ![]()
