home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 April / ME_04_2012.iso / Video-Tutorial / iPhoto / media / player.swf / scripts / mx / accessibility / LabelAccImpl.as < prev    next >
Encoding:
Text File  |  2011-11-11  |  1.8 KB  |  62 lines

  1. package mx.accessibility
  2. {
  3.    import flash.accessibility.Accessibility;
  4.    import flash.events.Event;
  5.    import mx.controls.Label;
  6.    import mx.core.UIComponent;
  7.    import mx.core.mx_internal;
  8.    
  9.    use namespace mx_internal;
  10.    
  11.    public class LabelAccImpl extends AccImpl
  12.    {
  13.       mx_internal static const VERSION:String = "4.5.0.20967";
  14.       
  15.       public function LabelAccImpl(param1:UIComponent)
  16.       {
  17.          super(param1);
  18.          role = AccConst.ROLE_SYSTEM_STATICTEXT;
  19.       }
  20.       
  21.       public static function enableAccessibility() : void
  22.       {
  23.          Label.mx_internal::createAccessibilityImplementation = mx_internal::createAccessibilityImplementation;
  24.       }
  25.       
  26.       mx_internal static function createAccessibilityImplementation(param1:UIComponent) : void
  27.       {
  28.          param1.accessibilityImplementation = new LabelAccImpl(param1);
  29.       }
  30.       
  31.       override protected function get eventsToHandle() : Array
  32.       {
  33.          return super.eventsToHandle.concat(["updateComplete"]);
  34.       }
  35.       
  36.       override public function get_accState(param1:uint) : uint
  37.       {
  38.          var _loc2_:uint = getState(param1);
  39.          _loc2_ &= ~AccConst.STATE_SYSTEM_FOCUSABLE;
  40.          return uint(_loc2_ | AccConst.STATE_SYSTEM_READONLY);
  41.       }
  42.       
  43.       override protected function getName(param1:uint) : String
  44.       {
  45.          var _loc2_:String = Label(master).text;
  46.          return _loc2_ != null && _loc2_ != "" ? _loc2_ : "";
  47.       }
  48.       
  49.       override protected function eventHandler(param1:Event) : void
  50.       {
  51.          $eventHandler(param1);
  52.          switch(param1.type)
  53.          {
  54.             case "updateComplete":
  55.                Accessibility.sendEvent(master,0,AccConst.EVENT_OBJECT_NAMECHANGE);
  56.                Accessibility.updateProperties();
  57.          }
  58.       }
  59.    }
  60. }
  61.  
  62.