[flexcoders] callLater calls from flex

2008-11-07 Thread christian.menzinger
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



[flexcoders] callLater calls from framework / validation after instances are already removed

2008-11-04 Thread christian.menzinger
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, ...).

Every time 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\UICompo\
nent.as:6293]
 at
mx.managers::LayoutManager/validateDisplayList()[framework\src\mx\manage\
rs\LayoutManager.as:605]
 at
mx.managers::LayoutManager/doPhasedInstantiation()[framework\src\mx\mana\
gers\LayoutManager.as:660]
 at Function/http://adobe.com/AS3/2006/builtin::apply()
 at
mx.core::UIComponent/callLaterDispatcher2()[framework\src\mx\core\UIComp\
onent.as:8565]
 at
mx.core::UIComponent/callLaterDispatcher()[framework\src\mx\core\UICompo\
nent.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


[flexcoders] Performance issues while creating several instances of DisplayObject at the same

2008-05-30 Thread christian.menzinger
Hi there,

while experimenting with Containers and UIComponents I received very
strange results. Is it possible that the instantiation and rendering
of about 150 DisplayObjects can take up to 3 seconds of processing time?

I have a very light weight application attached where 20 views
(containing a Label and a VBox) and in average 4 child views
(containing 2 Labels next to each other) are instantiated and rendered
at the same time.

The rendering of 1000 native FlashObjects like TextField in a pure
AS-Project takes about 95ms(!) to update the display!

The performance differs extremely if you don't set any width on the
parentViews.

Could you please check if I have overseen something or used bad code?
It would be great to get a hint how to increase the overall
performance. I need a solution which increases rendering performance
as much as possible and allows me to use text truncation and dynamic
setting of widths.

Thanks a lot in advance for everything that could lead me into the
right direction.

view sample Application (could download source by right clicking)
http://www.metadudes.com/samples/flex/performance_issue/LightWeightChildCreation.html


BR,
Chris