Using Flex classes in Flash CS4

A coworker of mine on the Flash Authoring team, Tareq AlJaber, has an excellent blog at where he explains how you can take advantage of some of the classes in the Flex.swc and use them in your Flash applications.

For more information, see the following posts:

As a long time Flex, Flash, and ColdFusion user I was very intruiged after reading Tareq’s blog, and within minutes was using the Flex ObjectUtil class in Flash CS4 to trace out large objects and arrays, using the [Embed] metadata to embed PNGs and assets from library SWFs into Flash CS4 components, using the Flex HTTPService classes to load remote XML and text and display it in the Flash TextArea control, and creating custom label functions in Flash which used the Flex CurrencyFormatter class. The best part is that it was all very easy! Just point to the correct Flex SWCs, import the correct mx.* packages, and then start coding.

2 Responses to Using Flex classes in Flash CS4

  1. Kevin Newman says:

    I recently embedded a Pixel Bender filter in an as3 file using FlashDevelop to compile, and was surprised when it “just worked” (after a brief popup window, asking if I wanted to use the Flex SDK) to compile the same class in Flash CS4. That was very impressive. :-)I was using this technique btw:

  2. Tink says:

    Flashers may also finding the binding stuff in Flex useful. I haven’t got my copy of CS4 yet, but means its using the same compiler as Flex, and therefore doesn’t ignore metadata the binding stuff should be available (we’ve been using it in AS 3.0 projects for a while).Another good one is preloading using the Frame metadata[Frame(factoryClass=”Preloader”)