这些东东都不是很难,只是方法不常用到或没注意到:)以后还有陆续有添加。同时也希望给位同学多多提供一些Tips
1、MouseEvent在某些时候要记得运行MouseEvent.updateAfterEvent();方法。主要表现在拖动的时候。
如果不执行该方法,会有延迟,比如拖动会有延迟。
2、某些时候要记得stopImmediatePropagation(参考:做个笔记Event的stopImmediatePropagation和stopPropagation方法)
主要表现在单击某元素的时候,不希望这个click操作到达下一层。因为stopImmediatePropagation立即进行了事件冒泡。防止对事件流中当前节点中和所有后续节点中的事件侦听器进行处理。
Example:
3、同AJAX一样,多次请求一个动态页面请加个时间戳,防止缓存。
4、Flex中使用TitleWindow时如果要通过代码控制CloseButton按钮记得使用invalidateDisplayList();方法
(参考:使用代码控制TitleWindow的showCloseButton的奇怪问题)
它其实实现的是mx.core.UIComponent的updateDisplayList()方法。但是不可能直接使用该方法。
Help中是这么写的。
Draws the object and/or sizes and positions its children. This is an advanced method that you might override when creating a subclass of UIComponent.
You do not call this method directly. Flex calls the
updateDisplayList()method when the component is added to a container using theaddChild()method, and when the component’sinvalidateDisplayList()method is called.If the component has no children, this method is where you would do programmatic drawing using methods on the component’s Graphics object such as
graphics.drawRect().If the component has children, this method is where you would call the
move()andsetActualSize()methods on its children.Components may do programmatic drawing even if they have children. In doing either, you should use the component’s
unscaledWidthandunscaledHeightas its bounds.It is important to use
unscaledWidthandunscaledHeightinstead of thewidthandheightproperties.
admin#flashas.net (#为@) 联系QQ:
:40777822
浙ICP备06033001号