Category Archives: ActionScript

ActionScript

ActionScript: Check if a xml attribute/element exists 检查XML属性/元素是否存在

Here is the XML:
<XeSex sexIDElement='MID'> <SexID> M </SexID> <Name> Male </Name> <Active> y </Active> <

More…

Posted in ActionScript | Tagged , , | Leave a comment

Flex Build: org.xml.sax.SAXParseException :The entity name must immediately follow the ‘&’ in the entity reference

在过去接近4年的时间里, 很少使用MXML, 几乎都是纯AS, 最近操作了一点点MXML, 譬如:
<s:Button enabled=”isDirty() && canSaveNow()” />
 
在build的时候遇到错误:
org.xml.sax.SA

More…

Posted in ActionScript | Tagged , , | Leave a comment

Replace all by Split/RegEx in ActionScript

Problem
We need replace all method.
Solution
use RegEx or split&jion;
Detailed explanation
We can use the following two methods:
private function

More…

Posted in ActionScript, Flex | Tagged , | Leave a comment

Flex: verticalScrollPolicy auto/on/off

最近碰到一个问题: 当Flex右侧垂直滚动条出现时, 下方水平滚动条必定随之出现, 详细的描述就是:
该UIComponent高度一定, 宽度设置为percent(也就是说宽度可以变化), 当Add一个内部组件到该UI上后, UI需要更多高度, 但高度一定, 只好出现右侧滚动条(默认的ScrollP

More…

Posted in ActionScript, Flex | Tagged , , | Leave a comment

Flex: 检查/撤销Datagrid编辑数据 Validate/revert editable Datagrid input value

Requirement: We want to validate user input in editable datagrid, and revert the original value(undo) if necessary.
Solution: Handle the ‘itemEditEnd’

More…

Posted in ActionScript | Tagged , , , , | Leave a comment