package com.oxylusflash.book { import flash.display.Sprite; import flash.events.TimerEvent; import flash.utils.Timer; // Popup window content. public class PopupWindowContent extends Sprite { private var w:Number = 0; private var h:Number = 0; public var popupWindow:PopupWindow; protected var autoHideTimer:Timer = new Timer(1500, 1); public function PopupWindowContent() { autoHideTimer.addEventListener(TimerEvent.TIMER_COMPLETE, autoHideTimer_timerCompleteHandler, false, 0, true); } /** * Show the message box. * @param message Message. * @param autoHide If true, the message box will automatically hide. */ protected function alertAbout(message:String, autoHide:Boolean = true):void { Global.msgBox.label = message; if (popupWindow) popupWindow.disable(); autoHideTimer.reset(); if (autoHide) autoHideTimer.start(); } protected function autoHideTimer_timerCompleteHandler(e:TimerEvent):void { Global.msgBox.hide(); if (popupWindow) popupWindow.enable(); } public function init():void { } public function reset():void { } override public function get width():Number { return w; } override public function set width(value:Number):void { w = Math.round(value); } override public function get height():Number { return h; } override public function set height(value:Number):void { h = Math.round(value); } } }