flex 常用元标签讲解
Flex
引入了元数据标签的概念,大多数人都使用过的
[Bindable]
标签便是其中的
meta tag
之一,它在代码中的作用就是向编译器提供如何编译程序的信息。实际上,这些标签并没有被编译到生成的
SWF
文件中,而只是告诉编译器如何生成
SWF
文件。
adobe
官网
http://livedocs.adobe.com/flex/3/html/help.html?content=metadata_3.html详细讲解了
16种
meta
的使用,简单如下表所示。
Tag
Description
[ArrayElementType]
Defines the allowed data type of each element of an Array.
[Bindable]
Identifies a property that you can use as the source of a data
binding expression.
[DefaultProperty]
Defines the name of the default property of the component when you
use the component in an MXML file.
[Deprecated]
Marks a class or class element as deprecated so that the compiler
can recognize it and issue a warning when the element is used in an
application.
[Effect]
Defines the MXML property name for the effect.
[Embed]
Imports JPEG, GIF, PNG, SVG, and SWF files at compile time. Also
imports image assets from SWC files.
[Event]
Defines the MXML property for an event and the data type of the
event object that a component emits.
[Exclude]
Omits the class element from the Flex Builder tag inspector. The
syntax is as follows:[Exclude(name="label",
kind="property")]
[ExcludeClass]
Omits the class from the Flex Builder tag inspector. This is
equivalent to the @private tag in ASDoc when applied to a class.
[IconFile]
Identifies the filename for the icon that represents the component
in the Insert bar of Adobe Flex Builder.
[Inspectable]
Defines an attribute exposed to component users in the attribute
hints and Tag inspector of Flex Builder. Also limits allowable values of the
property.
[InstanceType]
Specifies the allowed data type of a property of type
IDeferredInstance.
[NonCommittingChangeEvent]
Identifies an event as an interim trigger.
[RemoteClass]
Maps the ActionScript
相关文档:
flex三种连级方式:
内联:<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="var codetxt:Text=new Text">
</mx:Application>
级联:<mx:Application xmlns:mx="http: ......
Flex Builder 3.0 For Eclipse 3.3 安装方法
Flex Builder 3.0 For Eclipse 3.3 安装方法
这两天准备学习Flex,于是下载了Flex Builder 3.0 For Eclipse plugin准备安装.
但是安装后启动Eclipse,找了半天也没找到Flex.而且Flex Builder会把JRE也安装.觉得这样很不爽.
所以我想到能不能来个Flex Builder绿色安装方 ......
今天在做项目时候,在开始项目时候有一个很重要的问题,就是在做幻灯的项目时候,因为初始化的时候将图片全部加载进程序,造成项目启动的时候,机器就崩溃了,因为项目已经完成了,只能想一些补救的方法,就是利用flashplay的垃圾回收,以下是两种方法。
1. flash.system.System.gc();
2. try
& ......
2.2 代码实现
下面给出了FlexBuilder工程的一个文件,设置了Flash的布局。
view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
......
应为设计要求, 我需要计算String的宽度,
搜索了下网上的文章, 看到有用measureText(string)的,
可是用了下发现, 这个function得到的string大小, 不会根据字体的大小, 粗黑的变化,
始终返回同一个值, 也许是我的用法不对, 最后我没有这个方法,
改用了另外一个方法:
private function getTextWidth():int
{
&nbs ......