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.

Talking about Flash Catalyst and Adobe AIR in Rome at “Arrivano i guru”

Next week in Rome, starts a new Italian event called Arrivano i guru, where 6 speakers from designers to developers, talking about Adobe technologies and others arguments.
I’ll be speaker there and I choose to talk about Adobe AIR and Flash Catalyst Public Beta, because I think could be so interesting for people that comes to this event understand how to approach this new world and start to work with those technologies.
In fact I think in Italy there are few companies that approach AIR to create real desktop application and an overview about Flash Catalyst give me opportunity to introduce a new way to skinning your RIA or desktop applications and how to save lots of times in a real workflow.

In the same event you can find others session about Digital Imaging, Advanced technique with Indesign or Photoshop and SEO also.
I think could be very interesting for a lots of Italian people, so feel free to leave a comment here if you’d like to receive more information about this event.

For more information or registration take a look at official site event.
See you there guys.

Flash Builder Beta is out… my first tests

Finally is OUT! New Flash Builder version is out in labs.adobe.com

I spent all the evening to try new features, so I think that could be useful talking about that in my blog.
The new features that I like so much are:

  • States / Library / Modules: States are totally changed in a new version that make easier write in MXML, I love so much includeIn and excludeFrom attribute to decide in which state you can put or remove a particular component.
    If you want you can work also with group and add in the same group N states.
    Library is a new object that works like Flash library, so you can create a Definition (like a Symbol) and reuse it during your application, make attention because you are working with Element and not Child!
    States and Library increase a lots application KB so I prefer work with Modules that load in runtime mode. They have a new particular argument when you try to load it that is ByteArray (more information on Migration Guide on labs).
  • Automatic getter / setter / event handler: YESSS! I switch to FDT in last month because I increase my productivity to write AS3 code, now with Flash Builder you’ve a couple of actions to create getter, setter and event handler, that’s so cool!
  • New Drawing API: we have a lots of new interesting MXML tag to define a shape like a square or a rectangle, but the most interesting is Paths that allow you to create particular lines and shape with bezier curve via code
  • Advanced CSS selectors: another interesting feature is the new way to refer a component via CSS, in fact you can interact with MXML structure (all buttons in an hbox must be red and all buttons in a vbox must be black).
    Very easy and cool!
  • Flex Theme: that’s one of my favorite features, in fact with Flash Builder you can create custom Flex Theme and skin your application in a second! You can find more information about Theme in Ted Patrick blog.
  • DateGroup: Instead of using Repeater to repeat a particular object, now we have DataGroup that defines a dataprovider and how to render it via an ItemRender or an ItemRenderFunction.
  • Switch a Flex project to AIR: finally if your client doesn’t know what he wants, you can swtich a Flex app into an AIR desktop application directly from context menu of Package Explorer (new name of  Flex Navigator panel).

Remember to read Migration guide, it’s so interesting! Stay tuned for next Flash Builder and Catalyst tests!
Another great resource that is now live to see Flex 4 features is Tour de Flex that you can view directly from Adobe web site.

Bye bye