apache-flex - validateProperties() 和 invalidateProperties() 之间的区别

标签 apache-flex actionscript-3 flex4

谁能告诉我 validateProperties()invalidateProperties() 有什么区别?

最佳答案

invalidateProperties :

Marks a component so that its commitProperties() method gets called during a later screen update.

Invalidation is a useful mechanism for eliminating duplicate work by delaying processing of changes to a component until a later screen update. For example, if you want to change the text color and size, it would be wasteful to update the color immediately after you change it and then update the size when it gets set. It is more efficient to change both properties and then render the text with its new size and color once.

Invalidation methods rarely get called. In general, setting a property on a component automatically calls the appropriate invalidation method.

validateProperties :

Used by layout logic to validate the properties of a component by calling the commitProperties() method. In general, subclassers should override the commitProperties() method and not this method.

本质上,validate 直接调用 commitProperties,而 invalidate 等待下一帧执行。始终使用无效。

关于apache-flex - validateProperties() 和 invalidateProperties() 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7185594/

相关文章:

ios - 尝试在 flex ios 中写入只读数据库

apache-flex - Flexlib ScheduleViewer..如何处理项目的点击

css - 如何在单个 List 实例上设置滚动条外观?

flash - 对象引用作为字符串?

flash - 如何在 AVM2 字节码中找到方法?

javascript - 对 IE 和 FF 使用 JQuery 或 onbeforeunload

apache-flex - 使用多个模块时优化 Flex

ios - 将 Adob​​e Air App 交付到 AppStore 失败

actionscript-3 - 检查用户的 Flash 播放器是否具有音频功能。 (功能.hasAudio)

actionscript-3 - Flash Builder 因警告(绑定(bind)错误)而中断?