使用AS创建item renderer
有以下方法用于创建AS item render:
实现一个item renderer需要覆盖必要的方法,和调用必要的invalidation方法,具体取决于继承的父类。可选的覆盖以下方法:
Method
Description
|
Commits any changes to component properties, either to make the changes occur at the same time or to ensure that properties are set in a specific order.
For more information, see Implementing the commitProperties() method.
|
|
Creates any child components of the component. For example, the ComboBox control contains a TextInput control and a Button control as child components.
For more information, see Implementing the createChildren() method.
|
|
Sets the default size and default minimum size of the component.
For more information, see Implementing the measure() method.
|
styleChanged()
|
Detects changes to style properties.
For more information, see Overriding the styleChanged() method.
|
|
Sizes and positions the children of the component on the screen based on all previous property and style settings, and draws any skins or graphic elements used by the component. The parent container for the component determines the size of the component itself.
Note: You typically only have to implement this method when you use the mx.core.UIComponent class as the base class of your item renderer. You do not have to implement it when creating a subclass of the LabelItemRenderer class. OverrideLabelItemRenderer.drawBackground() and LabelItemRenderer.layoutContent() instead.
For more information, see Implementing the updateDisplayList() method.
|
如果父类是LabelItemRenderer,可能会覆盖以下方法:
Method
Description
drawBackground()
|
Defines the background display of the item renderer.
|
layoutContents()
|
Lays out the children of the item renderer.
|
使用invalidation机制需要用到以下方法:
Invalidation method
Description
|
Marks a component so that its commitProperties() method gets called during the next screen update.
|
|
Marks a component so that its measure() method gets called during the next screen update.
|
|
Marks a component so that its updateDisplayList() methods get called during the next screen update.
|
创建LabelItemRenderer的子类
覆盖drawBackground()或者layoutContents()方法。
分享到:
相关推荐
在Flex 4.5中,ActionScript的使用更加规范和高效,与MXML(标记语言)相结合,可以方便地创建用户界面。 3. **Spark组件**:Spark组件是Flex 4.5的一大亮点,它们具有更好的可定制性和性能,比MXML组件更灵活。...
Flex 4.5 API 是Adobe Flex框架的一个重要版本,它为开发者提供了丰富的工具和技术来创建交互式的、基于Web的应用程序。这个API集成了ActionScript 3.0,使得开发人员可以利用面向对象的编程能力来构建高效且动态的...
这个SDK是Adobe公司推出的一个开放源码框架,它允许开发者使用ActionScript 3.0语言和Flex框架来创建具有交互性、动态性和可视化效果的Web应用。在本文中,我们将深入探讨Flex 4.5 SDK的关键特性和使用方法。 1. **...
9. **Flex SDK**:了解Flex SDK的结构和使用是必要的,SDK包含了编译和运行Flex应用所需的全部工具,包括ActionScript编译器和Flex编译器。 10. **部署和优化**:学习资料可能会讲解如何将Flex应用部署到服务器,...
这个“3D网页效果展示墙”项目是利用Flex4.5和ActionScript3(As3)编写的,展示了在Web上实现高级图形和动画效果的潜力。 首先,我们来看“波纹效果”。波纹效果是一种动态图形效果,它模拟水面上波纹扩散的视觉...
在Flex 4.5 Mobile项目中,开发者使用ActionScript编写业务逻辑、处理事件和与服务交互。 5. **Mobile Skinning and Theming**:Flex 4.5提供了移动皮肤和主题机制,允许开发者根据目标设备和用户界面需求定制应用...
在Flex 4.5中,开发者可以利用Spark组件模型创建更具视觉吸引力的UI,同时受益于ActionScript 3.0的强大编程能力。 Spring 3是Java企业级应用开发的核心框架,提供了一整套服务,包括依赖注入、AOP(面向切面编程)...
Flex 4.5是Adobe公司推出的Flash平台中的一个重要版本,用于构建富互联网应用程序(RIA)。本书《flex4.5从浅入深》旨在帮助开发者深入理解Flex 4.5的各个方面,从基础知识到高级特性,逐步提升开发技能。标题表明...
通过上述知识点的总结,读者能够全面了解如何使用Adobe Flex 4.5和Flash Builder高效地开发移动应用,特别是在iPhone和Android平台上。无论是初学者还是有经验的开发者,都能够从中获得实用的指导和支持。
例如,在Flex3中,我们使用的是 `<mx:Application>` 作为根容器,而在Flex4.5中则是 `<s:Application>`,这反映了不同的命名空间和组件库。 #### 三、第一章:可视化组件运用 Flex中的“可视化组件”是指那些能够...
在Flex 4.5中,你可以通过MXML或ActionScript来创建和定制这些控件,利用属性和方法调整它们的外观和行为。例如,你可以设置控件的文本、大小、颜色,甚至添加自定义的行为。 接下来,事件侦听是Flex应用程序中不可...
6. **ActionScript 3.0**:作为Flex 4.5的编程语言,ActionScript 3.0的性能得到显著提升,类库和API也更加完善。本章将介绍AS3的关键特性,如面向对象编程、错误处理和高级类型系统。 7. **图形和动画**:Flex 4.5...
在本文中,我们将深入探讨如何使用Adobe Flex 4.5框架来开发针对Android操作系统的应用程序。Flex是一款强大的、基于ActionScript的开源开发工具,它允许开发者创建富互联网应用(RIA)以及跨平台的移动应用。Flex ...
2. **Flex 4.5**:Flex 是 Adobe 公司开发的一套用于创建富互联网应用程序(RIA)的框架,Flex 4.5 是其版本之一,支持 ActionScript 3.0 和 MXML,提供了更强大的组件库和设计工具,使开发者能构建更具交互性的用户...
总之,"Flex 4.5 开发安卓程序文档"是学习如何使用Flex进行Android开发的重要资料,涵盖了从项目创建到应用发布的全过程,同时也包含了一些性能优化和调试技巧。对于想要跨入Flex移动开发领域的开发者来说,这是一份...
Flex 4.5 打印功能是 Adobe Flex 开发框架中的一个重要组成部分,它允许开发者创建具有打印和打印预览功能的富互联网应用程序(RIA)。在 Flex 4.5 中,打印功能得到了显著增强,提供了更加灵活和精细的控制,使得...
这个版本是Flex SDK的一部分,它提供了一个强大的工具集,包括MXML和ActionScript编程语言,用于创建交互式的、图形丰富的Web应用。Flex 4.5引入了Spark组件集,提升了UI设计的灵活性和性能。 在描述中提到的“flex...
《使用Flex4.5开发Android应用程序》的源代码是一份宝贵的资源,它涵盖了Adobe Flex 4.5技术在Android平台上的应用开发知识。Flex 4.5,也被称为Flash Builder 4.5,是一款强大的集成开发环境(IDE),用于创建富...