validateProperties()和invalidateProperties之间差() [英] Difference between validateProperties() and invalidateProperties()

查看:153
本文介绍了validateProperties()和invalidateProperties之间差()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何一个可以告诉我一下 之间有什么区别 validateProperties() invalidateProperties()

Can any one tell me about what is the Difference between validateProperties() and invalidateProperties() ?

推荐答案

<一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/UIComponent.html#invalidateProperties%28%29"相对=nofollow> invalidateProperties 的:

标记组件,以便的commitProperties()方法被调用   在稍后的屏幕更新。

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.

<一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/UIComponent.html#validateProperties%28%29"相对=nofollow> validateProperties :

由布局逻辑用于通过来验证组件的属性   调用commitProperties()方法。一般情况下,子类不应   覆盖commitProperties()方法,而不是这个方法。

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.

从本质上讲,直接验证呼叫的commitProperties而无效等待下一帧做。始终使用无效。

Essentially, validate calls commitProperties directly while invalidate waits for the next frame to do it. Always use invalidate.

这篇关于validateProperties()和invalidateProperties之间差()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆