Hi all,
I have a very special problem:
By selecting an item in my navigation I start rendering my view with
several display objects (container, components, ...).
Everytime I select an other item, I remove all stuff from display list
(destroying all bindings, remove all listeners, setting everything to
null).
If I do very quick changes, after a while I receive null-pointer
exceptions in different classes in different validation methods
(measure / updateDisplayList) like
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at package::ClassName/updateDisplayList()[ClassName.as:490]
at
mx.core::UIComponent/validateDisplayList()[framework\src\mx\core\UICom
ponent.as:6293]
at
mx.managers::LayoutManager/validateDisplayList()[framework\src\mx\mana
gers\LayoutManager.as:605]
at
mx.managers::LayoutManager/doPhasedInstantiation()[framework\src\mx\ma
nagers\LayoutManager.as:660]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at
mx.core::UIComponent/callLaterDispatcher2()[framework\src\mx\core\UICo
mponent.as:8565]
at
mx.core::UIComponent/callLaterDispatcher()[framework\src\mx\core\UICom
ponent.as:8508]
The exception stack trace starts always by callLaterDispatcher like
above.
I think the null-pointer happen because the render engine applies a
call later for rendering in the next frame, unfortunately I removed
the instanced in time between and so all my component children are
null.
That brings me to the following questions:
- Could it be true that flex forces validation via callLater even if
the instance is removed? How could this be?
- If so, how can I solve the problem proper (e.g. remove all
callLaters in my destroy functions -> btw: there is a mx_internal
function cancelAllCallLaters() in UIComponent but that is not working
for me -> no effect if I call this function in my destroy functions)
- Or am I completely wrong and the problem is part of my custom
components development?
If you have any ideas or solutions which can guide me in the right
direction would be very cool.
Thanks a lot
Chris