아래 블로그에서 해결책을 찾았네요.
예전부터 저도 고심하던 버그였는데..
직접 SDK를 수정할 생각을 했었는데..(어리석었죠. 상속받아서 mx_internal을 사용할 생각을 못했었네요..)
버그 내용은 다음과 같습니다.
The bug will surface when a folder has no children and you try to close it using the expandItem function. Which in the case of the sample I use extensively.
The bug is in my opinion a Flex bug within the tree.as when tweening animation. The tree.as function buildUpCollectionEvents makes an assignment to a collection view of a null value (first line below) the next line attempts to access this value without a test. If no children exist when a folder has no children for example, the createCursor call is being done on a null object. Hence the error #1009.
Code from the tree.as
var children:ICollectionView = getChildren(expandedItem, iterator.view);
var cursor:IViewCursor = children.createCursor();
So what can we do when this happens. Well lucky for me the function called just before the “buildUpCollectionEvents” on the error stack is marked as internal.
mx_internal function onTweenEnd(value:Object):void
tree 노드를 isBranch 속성들을 지정해주거나 해서 폴더형태로 보여줬을 때,
나는 에러인데 닫을 때 발생하고.
이 분은 상속받은 Tree에서 처리를 하셨네요. try, catch로..
Because it’s marked internal I was able to override this and add a error handler on the extended version of the tree in order to gracefully handle it.
In order to override a function you need to add “use namespace mx_internal;” at the end of the imports. You can then override the “onTweenEnd” to control the error. The sample already contains the import “mx.core.mx_internal;”. The below code will handle the error.
override mx_internal function onTweenEnd(value:Object):void{
try{
super.mx_internal::onTweenEnd(value);
}
catch(err:Error){
//Tween failure a nasty flex bug.
//trace(err.message);
}
}
The bug seems after testing to be handled, and no adverse effects in doing this are noticeable.
p.s. 위에 올린 블로그 보면 모든 내용이 다 있습니다..
'ria > flex' 카테고리의 다른 글
| Flex Builder 2 Memory (0) | 2008/01/24 |
|---|---|
| ::: 최상의 유저 인터페이스 설계 방법 ::: (0) | 2008/01/21 |
| Tree isBranch를 강제 설정했을 때 버그 (0) | 2008/01/18 |
| ArrayCollection을 이용한 Tree Component 데이터 바인딩 (0) | 2008/01/18 |
| Flex Explorers (2) | 2008/01/18 |
| [강의자료] 웹 2.0 의 RIA 인터페이스 개발을 위한 Flex (0) | 2008/01/18 |




댓글을 달아 주세요