Modules and DragManager bug in Flex 3

In my last RIA project based on Flex 3, I find a bug working with modules that I’d like to sharing in this blog.

I create a dashboard where 4 custom components, that extend Panel component, load in a ModuleLoader differents sections.
In those sections there are components based on List component and when I run my project I’ve this kind of error:

TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::DragManagerImpl@21ef6df9 to mx.managers.IDragManager.

Surfing on web I don’t find anything about this kind of problem, finally on JIRA Adobe Flex bugs, I find it!
You can find workaround on JIRA ticket, it’s so easy to solve it, you only create a new instance of DragManager in your Default Application and everything works well.
This bug is created because you have more instance of DragManager in this sample, but DragManager in Flex framework is used like a Singleton so only one instance per time.
Each module has a List component that use DragManager when you have in the same application 2 or more modules you must put in Default Application file a DragManager instance and that’s it!
I think could be useful for anybody in the same situation.


8 thoughts on “Modules and DragManager bug in Flex 3

  1. Good find and thanks! I had run into that very issue awhile back never really finding the culprit and finally the UX changed such that it was no longer an issue. Guess I dodged a bullet back then.

  2. Great solution. Thanks very much.
    I had same problems and this was my solution, I insertet in Main.mxml the following and it works!

  3. In a mx:script put the two lines
    Line1: import mx.managers.DragManager;
    Line2: private var dummy:DragManager;

  4. With modules you can have a module-wide singleton or an application-wide singleton depending on whether you import the singleton class also in the main application or not. I’ve written a post on my blog about this that demonstrates the different behaviors. I think it could be useful to avoid strange behaviors of the singletons in each modular Flex application. You can check it at

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s