home *** CD-ROM | disk | FTP | other *** search
/ Ice Age Fan CD 1 / CD1_Scrat.iso / flash / data / game.swf / scripts / com / google / analytics / debug / Warning.as < prev   
Encoding:
Text File  |  2012-07-04  |  1.1 KB  |  47 lines

  1. package com.google.analytics.debug
  2. {
  3.    import flash.events.TextEvent;
  4.    import flash.events.TimerEvent;
  5.    import flash.utils.Timer;
  6.    
  7.    public class Warning extends Label
  8.    {
  9.       private var _timer:Timer;
  10.       
  11.       public function Warning(param1:String = "", param2:uint = 3000)
  12.       {
  13.          super(param1,"uiWarning",Style.warningColor,Align.top,false);
  14.          margin.top = 32;
  15.          if(param2 > 0)
  16.          {
  17.             _timer = new Timer(param2,1);
  18.             _timer.start();
  19.             _timer.addEventListener(TimerEvent.TIMER_COMPLETE,onComplete,false,0,true);
  20.          }
  21.       }
  22.       
  23.       public function close() : void
  24.       {
  25.          if(parent != null)
  26.          {
  27.             parent.removeChild(this);
  28.          }
  29.       }
  30.       
  31.       override public function onLink(param1:TextEvent) : void
  32.       {
  33.          switch(param1.text)
  34.          {
  35.             case "hide":
  36.                close();
  37.          }
  38.       }
  39.       
  40.       public function onComplete(param1:TimerEvent) : void
  41.       {
  42.          close();
  43.       }
  44.    }
  45. }
  46.  
  47.