当修改了RichTextEditor的某一属性,重新获取时,取到的确是没有更改前的值,这是为什么哪?
例如:
var nowBeginIndex:number;
nowBeginIndex = RichTextEditor.textArea.selectionBeginIndex;
--假设nowBeginInde == 10
RichTextEditor.textArea.selectionBeginIndex = 20;
nowBeginIndex = RichTextEditor.textArea.selectionBeginIndex;
--仍然nowBeginInde == 10
最后调试发现,原来需要调用,修改才会生效,它实际上是调用了一个commit..
RichTextEditor.textArea.validateProperties();
完整代码
var nowBeginIndex:number;
nowBeginIndex = RichTextEditor.textArea.selectionBeginIndex;
RichTextEditor.textArea.selectionBeginIndex = 20;
RichTextEditor.textArea.validateProperties();
nowBeginIndex = RichTextEditor.textArea.selectionBeginIndex;
估计很多控的属性都有类似问题,至于哪些控件的那些(种)属性,需要这样,我想肯定是有规律的,值得继续研究