Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Регистрация Блоги Правила Справка Пользователи Календарь Поиск рулит! Сообщения за день Все разделы прочитаны
 

Вернуться   Форум Flasher.ru > Блоги > Идиотизмы

Даже в определениях идиотизма встречается идиотизм.
Цитата:
Идиотизм — устаревшее название идиомы
Идиома в программировании — понятие близкое к понятию шаблона проектирования. Идиомы представляют собой шаблоны проектирования, учитывающие специфику конкретного языка программирования и потому не универсальные. Это хорошие решения проектирования для конкретного языка или программной платформы.
Оценить эту запись

Идиотизмы: Metadata у Stage

Запись от BlooDHounD размещена 08.06.2010 в 02:09
Обновил(-а) iNils 09.06.2010 в 13:26

для понимания материала необходимы следующие знания:
Metadata
flash.utils.describeType


у себя в проектах, я довольно часто использую метаданные.

в AS есть зарезервированный метатэг [Exclude], который скрывает указанную сущность в инспекторе билдера, и иногда в подсказках к коду. тэг должен применяться к классу. множество примеров можно обнаружить во Flex-фрэймворке. но этот метатэг применим не только для флекса, но и к обычным pure-as3 проектам.

так же этот тэг используется в стандартных классах. как известно у класса Stage есть ряд переопределённых свойств, которые кидают исключение при попытки обратится к ним. так вот эти свойства перечислены в [Exclude]-тэгах. правда идиотизм в том, что все эти тэги объявлены у свойства frameRate:
Код:
<type name="flash.display::Stage" base="flash.display::DisplayObjectContainer" isDynamic="false" isFinal="false" isStatic="false">
  <metadata name="Event">
    <arg key="name" value="fullScreen"/>
    <arg key="type" value="flash.events.FullScreenEvent"/>
  </metadata>
  <metadata name="Event">
    <arg key="name" value="resize"/>
    <arg key="type" value="flash.events.Event"/>
  </metadata>
  <metadata name="Event">
    <arg key="name" value="mouseLeave"/>
    <arg key="type" value="flash.events.Event"/>
  </metadata>
  <extendsClass type="flash.display::DisplayObjectContainer"/>
  <extendsClass type="flash.display::InteractiveObject"/>
  <extendsClass type="flash.display::DisplayObject"/>
  <extendsClass type="flash.events::EventDispatcher"/>
  <extendsClass type="Object"/>
  <implementsInterface type="flash.display::IBitmapDrawable"/>
  <implementsInterface type="flash.events::IEventDispatcher"/>
  <accessor name="accessibilityImplementation" access="readwrite" type="flash.accessibility::AccessibilityImplementation" declaredBy="flash.display::InteractiveObject">
    <metadata name="Inspectable">
      <arg key="environment" value="none"/>
    </metadata>
  </accessor>
  <accessor name="mask" access="readwrite" type="flash.display::DisplayObject" declaredBy="flash.display::DisplayObject"/>
  <accessor name="fullScreenHeight" access="readonly" type="uint" declaredBy="flash.display::Stage"/>
  <accessor name="rotationY" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="colorCorrectionSupport" access="readonly" type="String" declaredBy="flash.display::Stage"/>
  <accessor name="focusRect" access="readwrite" type="Object" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="scaleZ" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="transform" access="readwrite" type="flash.geom::Transform" declaredBy="flash.display::DisplayObject"/>
  <method name="setChildIndex" declaredBy="flash.display::Stage" returnType="void">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
    <parameter index="2" type="int" optional="false"/>
  </method>
  <method name="addChild" declaredBy="flash.display::Stage" returnType="flash.display::DisplayObject">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
  </method>
  <accessor name="height" access="readwrite" type="Number" declaredBy="flash.display::Stage"/>
  <accessor name="contextMenu" access="readwrite" type="flash.ui::ContextMenu" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="scrollRect" access="readwrite" type="flash.geom::Rectangle" declaredBy="flash.display::DisplayObject"/>
  <accessor name="rotation" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="accessibilityProperties" access="readwrite" type="flash.accessibility::AccessibilityProperties" declaredBy="flash.display::DisplayObject"/>
  <accessor name="tabIndex" access="readwrite" type="int" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="mouseEnabled" access="readwrite" type="Boolean" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="alpha" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="rotationZ" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="frameRate" access="readwrite" type="Number" declaredBy="flash.display::Stage">
    <metadata name="Exclude">
      <arg key="name" value="y"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="x"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="visible"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="transform"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="tabIndex"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="tabEnabled"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="scrollRect"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="scaleY"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="scaleX"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="scale9Grid"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="rotation"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="opaqueBackground"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="name"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="mouseEnabled"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="mask"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="loaderInfo"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="focusRect"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="filters"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="contextMenu"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="cacheAsBitmap"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="blendMode"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="alpha"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="accessibilityProperties"/>
      <arg key="kind" value="property"/>
    </metadata>
    <metadata name="Exclude">
      <arg key="name" value="accessibilityImplementation"/>
      <arg key="kind" value="property"/>
    </metadata>
  </accessor>
  <accessor name="x" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="stageFocusRect" access="readwrite" type="Boolean" declaredBy="flash.display::Stage"/>
  <accessor name="y" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <method name="isFocusInaccessible" declaredBy="flash.display::Stage" returnType="Boolean"/>
  <accessor name="tabEnabled" access="readwrite" type="Boolean" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="opaqueBackground" access="readwrite" type="Object" declaredBy="flash.display::DisplayObject"/>
  <accessor name="stageHeight" access="readwrite" type="int" declaredBy="flash.display::Stage"/>
  <accessor name="cacheAsBitmap" access="readwrite" type="Boolean" declaredBy="flash.display::DisplayObject"/>
  <accessor name="showDefaultContextMenu" access="readwrite" type="Boolean" declaredBy="flash.display::Stage"/>
  <accessor name="z" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="scaleX" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="visible" access="readwrite" type="Boolean" declaredBy="flash.display::DisplayObject"/>
  <accessor name="fullScreenWidth" access="readonly" type="uint" declaredBy="flash.display::Stage"/>
  <accessor name="colorCorrection" access="readwrite" type="String" declaredBy="flash.display::Stage"/>
  <accessor name="scaleY" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="wmodeGPU" access="readonly" type="Boolean" declaredBy="flash.display::Stage"/>
  <accessor name="focus" access="readwrite" type="flash.display::InteractiveObject" declaredBy="flash.display::Stage"/>
  <accessor name="mouseChildren" access="readwrite" type="Boolean" declaredBy="flash.display::Stage"/>
  <method name="dispatchEvent" declaredBy="flash.display::Stage" returnType="Boolean">
    <parameter index="1" type="flash.events::Event" optional="false"/>
  </method>
  <method name="willTrigger" declaredBy="flash.display::Stage" returnType="Boolean">
    <parameter index="1" type="String" optional="false"/>
  </method>
  <method name="hasEventListener" declaredBy="flash.display::Stage" returnType="Boolean">
    <parameter index="1" type="String" optional="false"/>
  </method>
  <method name="swapChildrenAt" declaredBy="flash.display::Stage" returnType="void">
    <parameter index="1" type="int" optional="false"/>
    <parameter index="2" type="int" optional="false"/>
  </method>
  <accessor name="scaleMode" access="readwrite" type="String" declaredBy="flash.display::Stage"/>
  <method name="addEventListener" declaredBy="flash.display::Stage" returnType="void">
    <parameter index="1" type="String" optional="false"/>
    <parameter index="2" type="Function" optional="false"/>
    <parameter index="3" type="Boolean" optional="true"/>
    <parameter index="4" type="int" optional="true"/>
    <parameter index="5" type="Boolean" optional="true"/>
  </method>
  <method name="invalidate" declaredBy="flash.display::Stage" returnType="void"/>
  <accessor name="align" access="readwrite" type="String" declaredBy="flash.display::Stage"/>
  <accessor name="width" access="readwrite" type="Number" declaredBy="flash.display::Stage"/>
  <accessor name="displayState" access="readwrite" type="String" declaredBy="flash.display::Stage"/>
  <method name="removeChildAt" declaredBy="flash.display::Stage" returnType="flash.display::DisplayObject">
    <parameter index="1" type="int" optional="false"/>
  </method>
  <method name="addChildAt" declaredBy="flash.display::Stage" returnType="flash.display::DisplayObject">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
    <parameter index="2" type="int" optional="false"/>
  </method>
  <accessor name="stageWidth" access="readwrite" type="int" declaredBy="flash.display::Stage"/>
  <accessor name="numChildren" access="readonly" type="int" declaredBy="flash.display::Stage"/>
  <accessor name="name" access="readwrite" type="String" declaredBy="flash.display::DisplayObject"/>
  <accessor name="blendMode" access="readwrite" type="String" declaredBy="flash.display::DisplayObject"/>
  <accessor name="tabChildren" access="readwrite" type="Boolean" declaredBy="flash.display::Stage"/>
  <accessor name="filters" access="readwrite" type="Array" declaredBy="flash.display::DisplayObject"/>
  <accessor name="fullScreenSourceRect" access="readwrite" type="flash.geom::Rectangle" declaredBy="flash.display::Stage"/>
  <accessor name="textSnapshot" access="readonly" type="flash.text::TextSnapshot" declaredBy="flash.display::Stage"/>
  <accessor name="scale9Grid" access="readwrite" type="flash.geom::Rectangle" declaredBy="flash.display::DisplayObject"/>
  <accessor name="rotationX" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="quality" access="readwrite" type="String" declaredBy="flash.display::Stage"/>
  <method name="getChildByName" declaredBy="flash.display::DisplayObjectContainer" returnType="flash.display::DisplayObject">
    <parameter index="1" type="String" optional="false"/>
  </method>
  <method name="getChildIndex" declaredBy="flash.display::DisplayObjectContainer" returnType="int">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
  </method>
  <method name="getChildAt" declaredBy="flash.display::DisplayObjectContainer" returnType="flash.display::DisplayObject">
    <parameter index="1" type="int" optional="false"/>
  </method>
  <method name="removeChild" declaredBy="flash.display::DisplayObjectContainer" returnType="flash.display::DisplayObject">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
  </method>
  <method name="areInaccessibleObjectsUnderPoint" declaredBy="flash.display::DisplayObjectContainer" returnType="Boolean">
    <parameter index="1" type="flash.geom::Point" optional="false"/>
  </method>
  <method name="swapChildren" declaredBy="flash.display::DisplayObjectContainer" returnType="void">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
    <parameter index="2" type="flash.display::DisplayObject" optional="false"/>
  </method>
  <method name="contains" declaredBy="flash.display::DisplayObjectContainer" returnType="Boolean">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
  </method>
  <method name="getObjectsUnderPoint" declaredBy="flash.display::DisplayObjectContainer" returnType="Array">
    <parameter index="1" type="flash.geom::Point" optional="false"/>
  </method>
  <accessor name="accessibilityImplementation" access="readwrite" type="flash.accessibility::AccessibilityImplementation" declaredBy="flash.display::InteractiveObject">
    <metadata name="Inspectable">
      <arg key="environment" value="none"/>
    </metadata>
  </accessor>
  <accessor name="focusRect" access="readwrite" type="Object" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="doubleClickEnabled" access="readwrite" type="Boolean" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="contextMenu" access="readwrite" type="flash.ui::ContextMenu" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="tabEnabled" access="readwrite" type="Boolean" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="mouseEnabled" access="readwrite" type="Boolean" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="tabIndex" access="readwrite" type="int" declaredBy="flash.display::InteractiveObject"/>
  <accessor name="stage" access="readonly" type="flash.display::Stage" declaredBy="flash.display::DisplayObject"/>
  <accessor name="rotationY" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="scaleZ" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="accessibilityProperties" access="readwrite" type="flash.accessibility::AccessibilityProperties" declaredBy="flash.display::DisplayObject"/>
  <accessor name="scrollRect" access="readwrite" type="flash.geom::Rectangle" declaredBy="flash.display::DisplayObject"/>
  <accessor name="rotationZ" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="alpha" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <method name="getBounds" declaredBy="flash.display::DisplayObject" returnType="flash.geom::Rectangle">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
  </method>
  <accessor name="x" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="blendShader" access="writeonly" type="flash.display::Shader" declaredBy="flash.display::DisplayObject"/>
  <accessor name="opaqueBackground" access="readwrite" type="Object" declaredBy="flash.display::DisplayObject"/>
  <accessor name="y" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="cacheAsBitmap" access="readwrite" type="Boolean" declaredBy="flash.display::DisplayObject"/>
  <accessor name="z" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <method name="local3DToGlobal" declaredBy="flash.display::DisplayObject" returnType="flash.geom::Point">
    <parameter index="1" type="flash.geom::Vector3D" optional="false"/>
  </method>
  <accessor name="visible" access="readwrite" type="Boolean" declaredBy="flash.display::DisplayObject"/>
  <accessor name="scaleX" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <method name="globalToLocal3D" declaredBy="flash.display::DisplayObject" returnType="flash.geom::Vector3D">
    <parameter index="1" type="flash.geom::Point" optional="false"/>
  </method>
  <accessor name="mouseX" access="readonly" type="Number" declaredBy="flash.display::DisplayObject"/>
  <method name="hitTestPoint" declaredBy="flash.display::DisplayObject" returnType="Boolean">
    <parameter index="1" type="Number" optional="false"/>
    <parameter index="2" type="Number" optional="false"/>
    <parameter index="3" type="Boolean" optional="true"/>
  </method>
  <accessor name="scaleY" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="mouseY" access="readonly" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="parent" access="readonly" type="flash.display::DisplayObjectContainer" declaredBy="flash.display::DisplayObject"/>
  <accessor name="mask" access="readwrite" type="flash.display::DisplayObject" declaredBy="flash.display::DisplayObject"/>
  <method name="getRect" declaredBy="flash.display::DisplayObject" returnType="flash.geom::Rectangle">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
  </method>
  <accessor name="rotation" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <accessor name="transform" access="readwrite" type="flash.geom::Transform" declaredBy="flash.display::DisplayObject"/>
  <method name="localToGlobal" declaredBy="flash.display::DisplayObject" returnType="flash.geom::Point">
    <parameter index="1" type="flash.geom::Point" optional="false"/>
  </method>
  <method name="globalToLocal" declaredBy="flash.display::DisplayObject" returnType="flash.geom::Point">
    <parameter index="1" type="flash.geom::Point" optional="false"/>
  </method>
  <accessor name="name" access="readwrite" type="String" declaredBy="flash.display::DisplayObject"/>
  <accessor name="blendMode" access="readwrite" type="String" declaredBy="flash.display::DisplayObject"/>
  <accessor name="root" access="readonly" type="flash.display::DisplayObject" declaredBy="flash.display::DisplayObject"/>
  <accessor name="filters" access="readwrite" type="Array" declaredBy="flash.display::DisplayObject"/>
  <accessor name="loaderInfo" access="readonly" type="flash.display::LoaderInfo" declaredBy="flash.display::DisplayObject"/>
  <accessor name="scale9Grid" access="readwrite" type="flash.geom::Rectangle" declaredBy="flash.display::DisplayObject"/>
  <accessor name="rotationX" access="readwrite" type="Number" declaredBy="flash.display::DisplayObject"/>
  <method name="hitTestObject" declaredBy="flash.display::DisplayObject" returnType="Boolean">
    <parameter index="1" type="flash.display::DisplayObject" optional="false"/>
  </method>
  <method name="toString" declaredBy="flash.events::EventDispatcher" returnType="String"/>
  <method name="removeEventListener" declaredBy="flash.events::EventDispatcher" returnType="void">
    <parameter index="1" type="String" optional="false"/>
    <parameter index="2" type="Function" optional="false"/>
    <parameter index="3" type="Boolean" optional="true"/>
  </method>
</type>
Всего комментариев 0

Комментарии

 

 


Часовой пояс GMT +4, время: 16:55.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2017, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.