March 9th, 2007 by Kyle
Tags: ActionScript, call-stack, components, debugging, Flex, invalidatedisplaylist, mxml, trace, updatedisplaylist, vbox
Posted in: Flex
I recently had a customer who was trying to debug his Flex components. Under certain circumstances the updateDisplayList() method of his component was getting called and it wasn’t obvious why.
In writing and debugging Flex components sometimes it would be useful to be able to see who called what method to figure out what is going on. Profilers are good for this, but unfortunately there is no Flex 2.0 (or 2.0.1) profiler. In speaking with Flex Engineer, Alex Harui (see his blog here), he suggested the strategy below:
- Subclass the component you are interested in (or if you are writing your own components just add the following to your component).
- Override the invalidateDislayList() method (or whatever method you are interested in).
- Create a new error object.
- Dump out the error objects getStackTrace() method.
This should get you the hierarchy of calls that caused the invalidateDisplayList call.
(And it is the calling of invalidateDisplayList that will flag the updateDisplayList() to be called.)
No Comments »

Recent Comments