25 March 2007 ~ 3 Comments

Using Flash in your Flex applications

Uncategorized

Since your flex applications run on the flash platform this seems like one of those no brainer type items. The problem comes in the fact that our flex applications utilize the new AVM 2 (actionscript virtual machine) thats available to us because we use the Flash Player 9 plugin. All our currently available Flash IDE generation tools still target the Flash 8 and earlier plugins. Technically we can use these 2 technologies together at the same time but then run in seperate AVM’s in the player. So to facilitate the communication between the 2 we have to go to some pretty creative uses of external communication.

Not being a person who enjoys the timeline focused development practices of traditional Flash development, this is not something I have spent a lot of time on personally. However I am always curious about these things as you never know when new requirements in a project will cause us to need this type of interaction.

Luckily both Jesse Warden and Grant Skinner took the time to tell us about some solutions to these problems at the recent 360Flex conference in San Jose. Back in December Jesse wrote an article about Integrating a Flash Interface into Flex 2. And today Grant posted about his “shake and bake” method of creating this interaction.

If the interaction of Flex and Flash is something you need to manage I have to recommend these articles for your perusal.

Tags:

3 Responses to “Using Flash in your Flex applications”

  1. barry.b 27 March 2007 at 5:37 am Permalink

    any idea how this would change with the Flash 9 IDE?

    hopefully simplify the whole process, one would hope…

  2. alimills 27 March 2007 at 10:01 am Permalink

    Hey Simeon,

    Good post! Here’s one that I wrote a while ago that talks in detail about using LocalConnection to communicate between the two AVMs: http://www.asserttrue.com/articles/2006/05/16/library-type-assets-in-actionscript-3-0-using-assets-created-with-current-releases-of-flash-authoring.

    And, it was updated a little later here: http://www.asserttrue.com/articles/2006/05/23/autocompleted-autocomplete-embed-legacy-swf-as3-0-project-example-updated-for-beta-3.

    They seem relevant to "using Flash in your Flex applications", so I thought I’d share.

    Have fun!

    Ali

  3. alimills 27 March 2007 at 10:04 am Permalink

    Links above blew out because of periods at the end, so here we go again…

    http://www.asserttrue.com/articles/2006/05/16/library-type-assets-in-actionscript-3-0-using-assets-created-with-current-releases-of-flash-authoring

    and

    http://www.asserttrue.com/articles/2006/05/23/autocompleted-autocomplete-embed-legacy-swf-as3-0-project-example-updated-for-beta-3

    Ali


PHVsPjxsaT48c3Ryb25nPndvb19hYm91dDwvc3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