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
相关文档:
BlazeDS + Hibernet + Flex 开发Web应用
网上有关于集成BlazeDS和Flex的示例,但是大部分都是将客户端和服务器代码放置到一个项目,这种方式使我们在编码时容易产生混淆,并且也不利于大的项目的开发与管理。下面通过一个简单的例子演示一下,建立客户端和服务器端分离的,服务器端采用Hibernet+BlazeDS的Flex Web项目。希 ......
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Script>
<![CDATA[
import mx.core.BitmapAsset;
import mx.core.DragSource;
import mx.events.DragEvent;
import mx.managers.DragManager;
private var xoffset:Number;
private var yoffset:Number;
priv ......
/*Copyright (c) 2006 Adobe Systems Incorporated
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, m ......
应为设计要求, 我需要计算String的宽度,
搜索了下网上的文章, 看到有用measureText(string)的,
可是用了下发现, 这个function得到的string大小, 不会根据字体的大小, 粗黑的变化,
始终返回同一个值, 也许是我的用法不对, 最后我没有这个方法,
改用了另外一个方法:
private function getTextWidth():int
{
&nbs ......