`
hjy2099
  • 浏览: 261314 次
  • 性别: Icon_minigender_1
  • 来自: 福州
社区版块
存档分类
最新评论

Flex Metatag

    博客分类:
  • Flex
阅读更多

Have you ever used [Bindable] in Flex? Do you know it is metatag? Apart from this, there are 12 more documented metatag in Flex framework. I will list them all out here for your reference:

ArrayElementType
Data type restriction like Java Generic

[ArrayElementType("String")]
public var arrayOfStrings:Array;

Bindable
Allows for easy data synchronization within the components. Bindable can be used to bind simple data, classes, complex data, functions and event. I will talk about this metatag in more detail later.

[Bindable]
[Bindable(event="eventname")]

DefaultProperty
The DefaultProperty metadata tag is used to set a single property as a default property of a class. The 3 label controls are equivalent with “text” defined as default property in the component, so you don’t need to put <text> tag around it.

<mx:label text=”Hello”></mx:label>
<mx:label>
<mx:text>Hello</mx:text>
</mx:label>
<mx:label>Hello</mx:label>

Embed
The Embed metadata tag is used to import images into your application. There are two ways to use Embed. You can either embed the image in ActionScript and assign it to a variable. Button 1 and 2 below do the same.

[Embed(source="myIcon.gif")]
[Bindable]
public var myIcon:Class;

<mx:Button label=”Icon Button 1″ icon=”{myIcon}”/>
<mx:Button label=”Icon Button 2″ icon=”@Embed(source=’myIcon.gif’)”/>

Event
The Event metadata tag is used to declare events that will be dispatched by your custom class. Adding this metadata tag to your class definition allows you to add an event handler function to the MXML tag used to instantiate your custom class. You insert the [Event] metadata tag before the class definition in an ActionScript file, or in the <mx:Metadata> block in an MXML file.

In Actionscript:
[Event(name="myClickEvent", type="flash.events.Event")]

In MXML:
<?xml version=”1.0″?>
<mx:TextArea xmlns:mx=”http://www.adobe.com/2006/mxml”>
<mx:Metadata>
[Event(name="myEnableEvent", type="flash.events.Event")]
</mx:Metadata>
….
</mx:TextArea>

Effect
The Effect metadata tag is used to define a custom effect that will be dispatched when an event occurs. An effect is paired with a trigger that invokes the effect. A trigger is an event, such as a mouse click on a component, a component getting focus, or a component becoming visible. An effect is a visible or audible change to the component that occurs over a period of time. You insert the [Effect] metadata tag before the class definition in an ActionScript file, or in the <mx:Metadata> block in an MXML file. Same as Event syntax above.

[Effect(name="darkenEffect", event="darken")]

IconFile
IconFile is used to identify the filename of a jpg, gif, or png file that will be used as the icon for your custom class. While the [Embed] meta tag can be used to embed images files, SWF files, music files, video files, etc, IconFile is only used to embed a file that will be used as the icon for the custom class.

[IconFile("icon.png")]
public class CustomButton extends Button
{}

Inspectable
The Inspectable metadata tag is used to define the attributes of your custom component that you would like to display in the code hints and property inspector of Flex Builder 2.

InstanceType
The [InstanceType] metadata tag specifies the allowed data type of a property. Example below shows that you can only assign instance data type “mx.controls.Label” to variable topRow of type IDeferredInstance.

[InstanceType("mx.controls.Label")]
public var topRow:IDeferredInstance;

NonCommittingChangeEvent
TBA

RemoteClass
TBA

Style
The Style metadata tag is used to define custom style properties for your components. Simply add the Style metadata tag or tags to your class definition and then use the getStyle method to retrieve its value. I will talk about this metatag in more detail later.

 

原文地址:http://www.solutionhacker.com/2007/06/03/flex-looking-into-metatag/ <noscript type="text/javascript"></noscript>

分享到:
评论

相关推荐

    FLEX与JSP结合并测试HTTPService与java用XML通信

    这可以通过解压缩`flex2_tag_library_for_jsp.zip`,并将`flex-bootstrap-jsp.jar`复制到`/WEB-INF/lib`目录,同时将`flex-webtier-jsp.jar`复制到`/WEB-INF/flex/jars`。之后,在`web.xml`文件中添加相应的`...

    FLEX与JSP结合并测试HTTPService与java用XML通信.doc

    这包括解压并复制`flex2_tag_library_for_jsp.zip`中的`flex-bootstrap-jsp.jar`到`/WEB-INF/lib`,并将`flex-webtier-jsp.jar`复制到`/WEB-INF/flex/jars`。然后在`web.xml`中添加`&lt;taglib&gt;`元素来注册这个库。 4....

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: When the curve contain more then one figure and they were all unconfined and curve have alternative brush then whole flex-object bounding rectangle was filed. - FIX: The MaskColor property ...

    jq input标签生成

    &lt;meta charset="UTF-8"&gt; &lt;title&gt;jq input标签生成 .tag-container { display: flex; flex-wrap: wrap; } .tag { margin: 5px; padding: 5px 10px; border: 1px solid #ccc; border-radius: 4px; } ...

    css日常公用样式与BUG解决方案

    - `viewport meta tag`: `&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;`,确保在移动设备上正确缩放。 4. **字体和文本样式** - `font-family`: 指定字体系列,通常使用多个字体,以防...

    低碳的终端Web开发

    演讲中还提到了视口元标签(Viewport Meta Tag)的重要性。通过合理设置视口元标签,可以控制网页在不同设备上的显示效果,如设置`width=device-width`可以使页面宽度与设备宽度相同,`initial-scale=1`则确保页面的...

    jquery实现添加自定义标签代码

    &lt;meta charset="UTF-8"&gt; &lt;title&gt;jQuery 自定义标签添加 &lt;script src="https://code.jquery.com/jquery-3.6.0.min.js"&gt;&lt;/script&gt; .tags-container { display: flex; flex-wrap: wrap; margin-top: 5px; } ...

    大学生抗疫逆行者网页作业 感动人物HTML网页代码成品 最美逆行者dreamweaver网页模板 致敬疫情感动人物网页设计制作

    Your browser does not support the video tag. 感动图集 图集1"/&gt; 图集2"/&gt; 图集3"/&gt; 感动新闻 新闻标题 新闻内容... &lt;!-- Main Content End --&gt; &lt;!-- Footer Start --&gt; &lt;p&gt;...

    KP-s-Challenges-:凯文·鲍威尔(Kevin Powell)的响应式布局挑战

    6. viewport meta tag:在HTML头部添加`&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;`,可以让网页根据设备的视口宽度进行适配,确保在移动设备上的正确显示。 在这个"凯文·鲍威尔的...

    jQuery Input文本框创建标签代码.zip

    &lt;meta charset="UTF-8"&gt; &lt;title&gt;jQuery 创建标签 &lt;script src="https://code.jquery.com/jquery-3.x.min.js"&gt;&lt;/script&gt; &lt;script src="js/main.js"&gt;&lt;/script&gt; &lt;div id="tagContainer"&gt;&lt;/div&gt; ``` 接...

    web-responsive

    6. **Viewport Meta Tag(视口元标签)**:在HTML头部添加 `&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;` 可以告诉浏览器如何调整页面的宽度以适应移动设备。 7. **Adaptive Techniques...

    JavaScript基础学习笔记

    * CSS 布局:flex 伸缩布局、移动 Web 开发等 * CSS 选择器:tag 选择器、class 选择器、id 选择器等 JavaScript 基础 * 变量和数据类型:number、string、boolean、array、object 等 * 运算符和控制结构:if 语句...

    resp_Jure_Juri-i-.github.io

    9. 视口元标签(Meta viewport tag):在HTML头部添加`&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;`,可以帮助控制移动设备上的页面缩放和宽度。 10. 测试与调试:使用Chrome开发者工具...

    html+css居中布局公司html网站模板

    - `viewport meta tag`:`&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;`,确保网页在移动设备上正确缩放。 5. 优化和性能: - CSS 预处理器(如Sass, Less):提供变量、嵌套规则等...

    51专题_html专题代码_

    7. **SEO优化**:对于运营活动,搜索引擎优化(SEO)也很关键,这可能涉及到元标签(`&lt;meta&gt;`)的使用,如`&lt;meta name="description"&gt;`来提供页面摘要,`&lt;meta name="keywords"&gt;`指定关键词等。 8. **性能优化**:...

    HTML、CSS、JavaScript语法简明速查表

    - **元信息**:`&lt;meta&gt;`标签用于设置字符编码、viewport等信息。 - **图像**:`描述"&gt;`插入图片。 - **链接**:`&lt;link rel="stylesheet" href="style.css"&gt;`引入外部样式表。 - **表单**:`&lt;form&gt;`, `&lt;input&gt;`, ...

    网页模块页面

    `&lt;head&gt;`包含元信息,如标题(`&lt;title&gt;`)、字符集(`&lt;meta charset="UTF-8"&gt;`)等;`&lt;body&gt;`则包含实际的网页内容。 2. 模块化思维:在网页模块页面中,我们常会遇到的模块包括导航栏(`&lt;nav&gt;`)、头部图像(`...

    模仿百度文库首页

    2. **头部信息** (`&lt;head&gt;`): 包含`&lt;meta&gt;`标签,用于设置字符编码、视口等信息;`&lt;title&gt;`标签定义了浏览器标签页上的标题。 3. **主体内容** (`&lt;body&gt;`): 这是页面可见内容的容器,包含各种元素如`&lt;header&gt;`、`...

Global site tag (gtag.js) - Google Analytics