_videoHolder.width / _videoHolder.height) { _video.width = _videoHolder.width; _video.height = _videoHolder.width / aspectRatio; _video.x = 0; _video.y = (_videoHolder.height - _video.height) / 2; } else { _video.width = _videoHolder.height * aspectRatio; _video.height = _videoHolder.height; _video.x = (_videoHolder.width - _video.width) / 2; _video.y = 0; } _videoHolder.addChild(_video); } private function stopCamera():void { _camera = null; if (_video != null) { _videoHolder.removeChild(_video); _video.attachCamera(null); _video.clear(); _video = null; } } private function setResolution(width:int, height:int):void { camWidth = width; camHeight = height; setAspectRatio(camWidth, camHeight); } private function setAspectRatio(width:int, height:int):void { aspectRatio = (width/height); this.minHeight = Math.floor((this.minWidth - PADDING_HORIZONTAL) / aspectRatio) + PADDING_VERTICAL; } ]]>