- 浏览: 1148848 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (411)
- Java Foundation (41)
- AI/机器学习/数据挖掘/模式识别/自然语言处理/信息检索 (2)
- 云计算/NoSQL/数据分析 (11)
- Linux (13)
- Open Source (12)
- J2EE (52)
- Data Structures (4)
- other (10)
- Dev Error (41)
- Ajax/JS/JSP/HTML5 (47)
- Oracle (68)
- FLEX (19)
- Tools (19)
- 设计模式 (4)
- Database (12)
- SQL Server (9)
- 例子程序 (4)
- mysql (2)
- Web Services (4)
- 面试 (8)
- 嵌入式/移动开发 (18)
- 软件工程/UML (15)
- C/C++ (7)
- 架构Architecture/分布式Distributed (1)
最新评论
-
a535114641:
LZ你好, 用了这个方法后子页面里的JS方法就全不能用了呀
页面局部刷新的两种方式:form+iframe 和 ajax -
di1984HIT:
学习了,真不错,做个记号啊
Machine Learning -
赵师傅临死前:
我一台老机器,myeclipse9 + FB3.5 可以正常使 ...
myeclipse 10 安装 flash builder 4.6 -
Wu_Jiang:
触发时间在将来的某个时间 但是第一次触发的时间超出了失效时间, ...
Based on configured schedule, the given trigger will never fire. -
cylove007:
找了好久,顶你
Editable Select 可编辑select
Programming ActionScript 3.0 / ActionScript language and syntax / Data types -> Data type descriptions:
http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_11.html
Java与Flex类型转换对照关系:
Data Access and Interconnectivity / Accessing Server-Side Data with Flex -> Using RemoteObject components:
http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html
类型检查:
http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_09.html
默认值:
http://blog.csdn.net/firetaker/archive/2010/04/23/5519019.aspx
What's the difference between using 'as' keyword and regular typecasting like SomeType(foo)?
http://www.flexfreaks.com/forums/viewtopic.php?id=5
当Array的数据发生变化的时候,用它作为数据源的控件不能感知这种变化;
而ArrayCollection和ArrayList在创建时均使用Array作为其参数source;可以让数据实现绑定;
ArrayCollection比ArrayList强的地方在于它有排序和过滤的功能,而ArrayList是没有的。
ArrayCollection类将Array公开为集合的封装,可用ICollectionView或IList接口的方法和属性处理;ArrayList可用IList接口的方法和属性处理封装的Array;
对ArrayCollection和ArrayList实例操作会修改原始数据。
Some tips:
使用 removeItemAt() 方法,就会删除基础 Array 中的项目。[/b]
Array.filter()会生成一个新的数组;而arrayCollection's filterFunction不会改变arrayCollection的source Array;
使用arrayCollection.toArray()会返回一个与原来arrayCollection的source不同的Array:
http://blog.152.org/2010/04/flex-copy-arraycollection.html
ActionScript core 中的ArrayList和ArrayCollection两种类型的区别是什么?
他们的相同点是:都是以Array作为source来创建的;
不同点是:
http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_11.html
引用
The primitive data types include Boolean, int, Null, Number, String, uint, and void. The ActionScript core classes also define the following complex data types: Object, Array, Date, Error, Function, RegExp, XML, and XMLList.
Subtopics
Boolean data type
int data type
Null data type
Number data type
String data type
uint data type
void data type
Object data type
Subtopics
Boolean data type
int data type
Null data type
Number data type
String data type
uint data type
void data type
Object data type
Java与Flex类型转换对照关系:
Data Access and Interconnectivity / Accessing Server-Side Data with Flex -> Using RemoteObject components:
http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html
类型检查:
http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_09.html
引用
The is operator
The is operator, which is new for ActionScript 3.0, allows you to test whether a variable or expression is a member of a given data type. In previous versions of ActionScript, the instanceof operator provided this functionality, but in ActionScript 3.0 the instanceof operator should not be used to test for data type membership. The is operator should be used instead of the instanceof operator for manual type checking, because the expression x instanceof y merely checks the prototype chain of x for the existence of y (and in ActionScript 3.0, the prototype chain does not provide a complete picture of the inheritance hierarchy).
The as operator
The as operator, which is new in ActionScript 3.0, also allows you to check whether an expression is a member of a given data type. Unlike the is operator, however, the as operator does not return a Boolean value. Rather, the as operator returns the value of the expression instead of true, and null instead of false. The following example shows the results of using the as operator instead of the is operator in the simple case of checking whether a Sprite instance is a member of the DisplayObject, IEventDispatcher, and Number data types.
The is operator, which is new for ActionScript 3.0, allows you to test whether a variable or expression is a member of a given data type. In previous versions of ActionScript, the instanceof operator provided this functionality, but in ActionScript 3.0 the instanceof operator should not be used to test for data type membership. The is operator should be used instead of the instanceof operator for manual type checking, because the expression x instanceof y merely checks the prototype chain of x for the existence of y (and in ActionScript 3.0, the prototype chain does not provide a complete picture of the inheritance hierarchy).
var mySprite:Sprite = new Sprite(); trace(mySprite is Sprite); // true trace(mySprite is DisplayObject);// true trace(mySprite is IEventDispatcher); // trueThe following example shows the same tests from the previous example, but with instanceof instead of the is operator. The instanceof operator correctly identifies that mySprite is an instance of Sprite or DisplayObject, but it returns false when used to test whether mySprite implements the IEventDispatcher interface.
trace(mySprite instanceof Sprite); // true trace(mySprite instanceof DisplayObject);// true trace(mySprite instanceof IEventDispatcher); // false
The as operator
The as operator, which is new in ActionScript 3.0, also allows you to check whether an expression is a member of a given data type. Unlike the is operator, however, the as operator does not return a Boolean value. Rather, the as operator returns the value of the expression instead of true, and null instead of false. The following example shows the results of using the as operator instead of the is operator in the simple case of checking whether a Sprite instance is a member of the DisplayObject, IEventDispatcher, and Number data types.
var mySprite:Sprite = new Sprite(); trace(mySprite as Sprite); // [object Sprite] trace(mySprite as DisplayObject); // [object Sprite] trace(mySprite as IEventDispatcher); // [object Sprite] trace(mySprite as Number); // null
默认值:
http://blog.csdn.net/firetaker/archive/2010/04/23/5519019.aspx
What's the difference between using 'as' keyword and regular typecasting like SomeType(foo)?
http://www.flexfreaks.com/forums/viewtopic.php?id=5
引用
The main difference between as operator and regular typecasting is the behavior when conversion fails. In Actionscript 3, when a typecast fails, TypeError error is thrown. Using the as keyword, the default value for that data type (usually null) is returned when cast fails. as is essentially like is. It does a type comparison, but instead of returning true or false, as returns the data or null on type mismatch.
var foo:Object = "bar"; trace( MovieClip ( o ) ); // TypeError thrown trace(foo as ComboBox); // returns null
区别与联系:Array & ArrayCollection & ArrayList
当Array的数据发生变化的时候,用它作为数据源的控件不能感知这种变化;
而ArrayCollection和ArrayList在创建时均使用Array作为其参数source;可以让数据实现绑定;
ArrayCollection比ArrayList强的地方在于它有排序和过滤的功能,而ArrayList是没有的。
ArrayCollection类将Array公开为集合的封装,可用ICollectionView或IList接口的方法和属性处理;ArrayList可用IList接口的方法和属性处理封装的Array;
对ArrayCollection和ArrayList实例操作会修改原始数据。
Some tips:
使用 removeItemAt() 方法,就会删除基础 Array 中的项目。[/b]
Array.filter()会生成一个新的数组;而arrayCollection's filterFunction不会改变arrayCollection的source Array;
使用arrayCollection.toArray()会返回一个与原来arrayCollection的source不同的Array:
http://blog.152.org/2010/04/flex-copy-arraycollection.html
引用
var arrayCollection1:ArrayCollection = new ArrayCollection([1,2,3,4,5]); var arrayCollection2:ArrayCollection = new ArrayCollection(arrayCollection1.toArray()); trace("arrayCollection1: " + arrayCollection1.toString()); trace("arrayCollection2: " + arrayCollection2.toString()); arrayCollection1.removeItemAt(0); trace("arrayCollection1: " + arrayCollection1.toString()); trace("arrayCollection2: " + arrayCollection2.toString()); Output: arrayCollection1: 1,2,3,4,5 arrayCollection2: 1,2,3,4,5 arrayCollection1: 2,3,4,5 arrayCollection2: 1,2,3,4,5
ActionScript core 中的ArrayList和ArrayCollection两种类型的区别是什么?
他们的相同点是:都是以Array作为source来创建的;
不同点是:
引用
ArrayList and ArrayCollection both can be used to store and manipulate list data. Both supports flex data binding which can drive the watching object to update itself on data change.
However the key difference between ArrayList and ArrayCollection is that ArrayCollection has additional logic to sort and filter the list data however ArrayList is created specifically to hold and manipulate data and still be bindable. Thus ArrayList is lighter version of ArrayCollection.
Note: ArrayList is added in Flex 4 thus it will not be availalble in previous versions of flex sdk.
使用上也有些微的区别:However the key difference between ArrayList and ArrayCollection is that ArrayCollection has additional logic to sort and filter the list data however ArrayList is created specifically to hold and manipulate data and still be bindable. Thus ArrayList is lighter version of ArrayCollection.
Note: ArrayList is added in Flex 4 thus it will not be availalble in previous versions of flex sdk.
引用
(i 为 索引值)
ArrayList和ArrayCollection中放的都是对象数组;但ArrayCollection既可以用source属性做遍历,也可以直接用arrayCollection[i]做遍历;而ArrayList是可以用source属性做遍历。
不过他们有个通用的遍历方式:
ArrayList和ArrayCollection中放的都是对象数组;但ArrayCollection既可以用source属性做遍历,也可以直接用arrayCollection[i]做遍历;而ArrayList是可以用source属性做遍历。
不过他们有个通用的遍历方式:
arrayCollectionOrArrayListInstance.getItemAt(i)
发表评论
-
myeclipse 10 安装 flash builder 4.6
2011-12-11 12:47 15454从Flash Builder 4 之后,ado ... -
FLEX:Nested Object & Nested Data Grid
2011-08-15 18:14 2159Flex Nested Object & Nested ... -
FLEX 服务器端交互: remoteObject & AsyncToken & 数据定时刷新 & Timer
2011-06-21 18:47 2788动态调用RemoteObject: Dynamically i ... -
FLEX : Tree & contextMenu & Array's filter & ArrayCollection's filterFunction
2011-05-29 16:05 1932Using Flex 4.5 / Using data-dri ... -
FLEX : ObjectProxy & <fx:Model> tag
2011-05-28 21:37 2024今天碰到了一个非常让我困扰的问题,使我觉得很有必要对Objec ... -
Flex:Application&Variable Scope(this owner parent parentApp parentDoc outerDoc)
2011-05-28 17:18 1433关键字: this owner parent parentA ... -
Flex : Performance tuning 性能调优
2011-05-28 14:50 1708附件: Flex Application Performanc ... -
FLEX example 例子
2011-05-28 12:12 3234How to find an ArrayCollection ... -
FLEX : Validator 验证
2011-05-26 23:57 2213Data Access and Interconnectivi ... -
FLEX : Event 事件
2011-05-24 19:51 1725ActionScript 3.0 Developer’s Gu ... -
FLEX:Data Binding 数据绑定
2011-05-24 14:44 3645务须精读的文章: Flex data binding pitf ... -
FLEX Component 组件 汇总
2011-05-23 13:56 2312Combox默认将对象中名为label的属性作为显示用的lab ... -
FLEX : dragEnabled & dropEnabled
2011-05-22 17:38 1720通过设置dragEnabled属性为true,可以使这些控件作 ... -
FLEX ERROR WARNING 总结
2011-05-22 08:13 3244常会碰到的错误:TypeError: Error #1009: ... -
Flex: labelFunction versus ItemRenderer
2011-05-22 07:16 3297When to Use labelFunction versu ... -
Flex Application 初始化顺序
2011-05-22 06:15 1670http://blog.csdn.net/chengyong ... -
Flex Metadata 元数据:Bindable(注意首字母大写),etc
2011-05-22 06:08 1782Adobe® Flex™ 3.2 语言参考 -> 元数据 ... -
FLEX笔记
2009-04-15 10:29 2347Adobe Flex 4 官方资料库: http://help ...
相关推荐
在本文中,我们将深入探讨如何使用Flex来解析XML文件,并将其内容用作ComboBox下拉列表的数据源。首先,让我们理解Flex的基本概念。Flex是Adobe开发的一种开放源代码的富互联网应用程序(RIA)框架,用于构建和部署...
在Flex应用程序开发中,资源管理是一项关键任务,它涉及到如何有效地加载、管理和使用应用程序所需的文本、图像、声音、视频等多种类型的数据。本资料主要聚焦于在Flex中如何嵌入和管理这些资源,以提高应用程序的...
- **文件类型验证**:在用户选择文件时,可以通过`FileReference`的`type`属性检查文件类型,避免非法文件的上传。 - **上传队列**:对于大文件,可以实现上传队列,防止因长时间上传导致的用户界面阻塞。 6. **...
开发者可以监听`FileReference`的事件,如`select`、`data`和`uploadCompleteData`,来处理文件选择、数据读取和上传完成的逻辑。 文件上传的过程通常包括以下步骤: 1. 用户在Flex应用中点击文件选择按钮,触发`...
基于数据类型动态创建组件** 除了重复显示相同的组件外,还可以根据数据项的不同类型动态地创建不同类型的组件。例如,你可以基于某个字段的值来决定显示`Image`还是`Label`。 **5. Repeater组件的工作原理** 当...
- 文件数据通常以二进制流的形式发送,可能需要设置Content-Type为multipart/form-data。 4. Java后端处理: - Java服务器接收到请求后,Servlet或Controller解析请求体,提取文件数据。 - 文件数据存储到服务器...
在IT行业中,将图表库如AmCharts嵌入到Flex应用程序中是一种常见的需求,尤其是在需要创建交互式、数据可视化展示时。AmCharts是一个功能强大的JavaScript图表库,提供了多种类型的图表,如柱状图、线图、饼图等。而...
Flex提供了多种内置事件,如鼠标点击事件(click)、键盘事件(keyDown、keyUp)和数据变化事件(dataChange)。此外,自定义事件也是Flex编程中的常见实践,允许开发者为特定业务逻辑定义自己的事件类型。 三、...
- **步骤**: 新建Flex项目,设置项目名称、目录、类型以及服务器技术。 - **示例**: 在FlexBuilder中选择`New -> Flex Project`。 - **选择**: `Application type`保持默认;`Server technology`选择`J2EE`。 - ...
- `AppEvent(type, data, callback)`:创建一个事件实例,其中`type`表示事件类型,`data`表示随事件传递的数据,而`callback`则是在事件处理完成后执行的回调函数。 - **EventBus**:作为事件总线,它实现了单例...
我们需要设置其data属性为包含文件的二进制数据,Content-Type为multipart/form-data,以便上传文件。 3. **后端 ASP.NET 接收文件**:在ASP.NET中,我们可以创建一个Web服务或API控制器来接收POST请求。使用...
public function CustomEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false, data:Object=null) { super(type, bubbles, cancelable); this.data = data; } } ``` 2. **派发自定义事件**:在...
2. **事件类型**:每个事件类都有一个唯一的字符串标识符,称为事件类型(EventType),如` MouseEvent.CLICK`、`FlexEvent.CREATION_COMPLETE`等。开发者可以通过事件类型来识别并处理不同类型的事件。 3. **事件...
在这个例子中,`MY_CUSTOM_EVENT`是自定义事件的类型常量,`myData`是一个附加数据属性。构造函数允许设置事件的基本属性:类型、是否冒泡和是否可取消。 接下来,在MXML中,你可以使用`<fx:Declarations>`标签来...
- **答案**:在AS3中,数组(Array)可以存储不同类型的数据。例如,一个数组可以同时包含整数、字符串或对象等不同类型的元素。 - **示例代码**: ```as3 var myArray:Array = new Array(); myArray.push(1); //...
可以使用`name`属性获取文件名,`type`获取文件类型。 4. **文件上传**:使用`FileReference`的`upload()`方法将文件上传到服务器。此方法需要一个`URLRequest`对象,该对象的`url`属性应设置为服务器端处理上传...
- 在Flex客户端中,可以通过`URLVariables`对象来发送和接收AMF格式的数据。 - 示例代码: ```actionscript var request:URLRequest = new URLRequest("http://localhost:8080/amf"); var response:URLLoader = ...
自定义事件允许开发者创建特定于应用的事件类型,以便更好地控制数据流动和响应处理。以下是对FLEX自定义事件的详细介绍: 首先,自定义事件是通过继承Flash的`Event`类来创建的。在Flex中,`Event`类提供了基本...
Model定义了数据字段及其类型,Columns则定义了Grid显示的列。 1. **创建数据模型(Model)** 在ExtJS中,你需要定义一个数据模型来描述从服务器接收的数据结构。例如: ```javascript Ext.define('User', { ...
- **封装数据**:通过 `URLVariables` 将需要发送的数据封装起来,并设置到 `URLRequest` 对象的 `data` 属性上。 - **监听事件**:为 `URLLoader` 添加 `Event.COMPLETE` 事件监听器,在事件触发时处理服务器返回的...