Over a million developers have joined DZone.

Integrating Flash Components with Flex Revisited

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

A reader asks:


…is it possible to integrate a Flash component (like those on http://www.digicrafts.com.hk/ as an example, or any other third party component), with Flash Builder?

At a high level, yes. Any ActionScript 3 component can run in Flash Player 9 on up.

Flash Builder is perfectly capable of creating pure ActionScript 3 projects with no Flex dependencies. However, there are a few things that often cause problems when components play with other component frameworks, specifically something else used in a Flex project. The most common is access to stage, which in turn causes problems with focus and initialization.

Specifically, the AS3 components that come with Flash CS3, CS4, and CS5/5.5. It looks like Digicrafts are built either on top of their own architecture to work in the Flash IDE, or are built on top of the Flash component architecture.

If the former, you’re fine. If the later, you may have problems with stage and/or focus.

I’ve used Flash components in Flex projects. It’s mostly the workflow that’s the worst because of the long compilation times and the weird way you edit code in 2 places. Basically:

  1. open Flash
  2. drag a component you need to stage
  3. right click on it in Library > Export to SWC
  4. put this SWC in your Flash Builder libs folder

For Flash graphics, this is great. For code….. not so much. I’m a huge proponent of using the Flash IDE in this way for graphics and workflow with designers and developers. I am NOT a proponent of doing any serious development in the Flash IDE in this way. It’s a time sink.

You’ll have to make the decision in a few Proof of Concepts how much time it’ll take to make the Digi (or any 3rd party) components to work in Flex. Do you work through the issues? Do you convert to pure AS3? Converting to Flex usually involves Flash’s UIComponent base class changing to Flex’ UIComponent. Often this is pretty straight forward and can be done within a reasonable time frame.

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.


Published at DZone with permission of Jesse Warden, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}