LiGl's blog

DragDrop时, 使用DragEvent.dragInitiator来获得Drag源头, 而非DragEvent.relatedObject

问题描述:

在进行DragDrop时, 我使用了DragDrop.relatedObject来获得Drag触发的UIComponentpng-1048

如: var dargUI:TileList = e.relatedObject as TileList;

在AIR中运行, 可用且没有任何错误, 但当使用浏览器版本时, e.relatedObject为null, 上一行代码报错.

 

ListBase进行拖拽时collectionChangeHandler()报错的解决方法

在基于ListBase进行拖拽以移动对象时, 时常会出现如下错误:png-0673

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at mx.controls.listClasses::ListBase/collectionChangeHandler()
[C:\autobuild\3.4.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:8190]

ActionScript中使用自定义组件 Use CustomUI in Flex with ActionScript

png-1414

一: 需求

要求使用get ui获得一个UICompontent[DataGrid], 其中DataGrid某列的ItemEditor为ComboBox,且该UICompontent的右键菜单中有一个Item: 删除 [删除当前选定的行]
使用set value 来设定该UICompontent的dataProvider.[为了简单起见, 在测试时直接set一个ArrayCollection]

Flex单例模式 Flex Singleton Pattern

1. 概述 png-2068

Singleton Pattern的关键在于,只允许有一个对象存在.有时候我们需要有且只有一个对象存在,如播放器播放的歌曲, 购物车中的总额等.这些类对象只能有一个实例,如果制造出多个实例,就会导致很多问题.单例模式也给了我们一个全局的访问点,相对于全局变量来说, 单例模式采用的时lazy instantiaze,即在需要这个实例时才会创建.如果不需要这个实例,则永远不会产生.

在Flex/AIR中使用Drag And Drop. Using Drag And Drop in Flex/AIR

关于Drag和Drop的基础知识与基本应用可以参见:http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_1.html png-0048

1. 设计目标

实现Flex/AIR中的Tree,DataGrid自身或相互之间的拖动.

本例仍旧使用NoteManagement,关于NoteManagement的相关信息请参见:
1.完整Flex程序+详细解释之便条管理系统(Tree/回溯/XML/Event) Annotated Flex Sample Application: Note Management
2.使用Air与SQLite开发NoteManagement
3.Flex树形菜单动态加载 Flex Tree Dynamic Loading
通过以上三篇文章,您将对NoteManagement有一个概括性的了解.

Flex树形菜单动态加载 Flex Tree Dynamic Loading

1. 设计目标:png-1163

Flex中Tree动态加载,即在点击之后才加载下级目录的内容.

2. 概要设计:

Tree的属性:
dataDescriptor="{new CategoryTreeDataDiscriptor()}" 
dataProvider="{Category.root}" id="treeCategory"
通过root对象与dataDescriptor提供给Tree数据.

使用Air与SQLite开发NoteManagement

1. 设计目标:

png-0808

设计NoteManagement 的Air 版,使用SQLite数据,实现之前所有的功能,如:用户注册登录,目录及便条的增加删除修改等.[点此查看NoteManagement的WEB版].

2. 概要设计:

相对于前述WEB 版,Air 版的数据源已不再是ShareObject或XML,所以需要通过对数据库的存取进行操作.
另外,考虑到性能,对于Tree 进行Dynamic Loading, 以优化性能.

[学习笔记]Event与Bindable

Event: png46

1.事件派发 Dispatching

Flash.events.EventDispacher类提供了事件dispatch函数,如果需要dispatch事件,则应该考虑继承该类或其子类.如果不能继承该类,则应实现IEventDispatcher接口 

2.监听事件 Listening to Events

BlazeDS配置实例 BlazeDS Configuration

1.什么是BlazeDS

BlazeDS is the server-based Java remoting and web messaging technology that enables developers to easily connect to back-end distributed data and push data in real-time to Adobe® Flex® and Adobe AIR™ applications for more responsive rich Internet application (RIA) experiences.

完整Flex程序+详细解释之便条管理系统(Tree/回溯/XML/Event) Annotated Flex Sample Application: Note Management

演示+代码

一 目标及要求:

设计一个小程序,用以记录备忘等小东西,需要有一个目录,一个按照目录分门别类的显示目录下的Notes.同时应具有,CRUD[Create,Read,Update,Delete]目录与Note的功能,Tree的dataprovider不能为XML,应使用ITreeDataDescriptor.所有数据存放于SharedObject中.

文件属性设置UI设计 - 初探Flex中自定义组件 Custom UI Component Example: Unix File Permission Setting

一:目标

设计一个自定义组件,可以通过该UI初步读取或设置文件属性.

二:设计

概要设计:
  • 1.界面使用checkbox.分别对应Ower,Group,Public的Read,Write,Excute权限
  • 2.定义变量
  • 3.定义get set函数,定义checkbox状态与permission的转换函数,相关Event;
详细设计:

命名:

组件名称:PermissionUI;

各checkbox命名:checkOwnerRead, checkOwnerWrite, checkOwerExecute, checkGroupRead, ..., checkPublicExecute.

变量命名:private _permission;

Syndicate content