Be careful what you loadmovie…

After being involved with AS3 and Flex for so long, I think I am now at a point where I have a really good understanding of the Flex framework. So when I was asked to build this online app, I immediately started it with Flex and before long had most of it working. However, the application was supposed to be a subcomponent of a larger AS2 project and was supposed to be loadmovie-ed. I didn’t realize till too late that AS2 swfs actually cannot loadmovie AS3 swfs (well Flex for sure, not sure about AS3 but doubt that too). This definitely left me feeling very ‘d-uh’. We ended up working around this by creating an AS3 base swf that loads the AS2 swf and then when the sub-app was supposed to be loaded, the AS2 swf told the base movie to do so via LocalConnection. This is definitely a hack but I couldn’t think of any other way to get this to work.

If anyone is aware of this or has successfully managed to load an as3 swf into an as2 swf via loadmovie, do drop me a comment. For others, be careful what you loadmovie ;).

Author: Arpit Mathur

Arpit Mathur is a Principal Engineer at Comcast Labs where he is currently working on a variety of topics including Machine Learning, Affective Computing, and Blockchain applications. Arpit has also worked extensively on Android and iOS applications, Virtual Reality apps as well as with web technologies like JavaScript, HTML and Ruby on Rails. He also spent a couple of years in the User Experience team as a Creative Technologist.

2 thoughts on “Be careful what you loadmovie…”

  1. Flash SWF9 ( if it uses AS3) cannot be loaded into SWF8 or lower. This is because SWF9 uses AVM2, and SWF8 uses AVM1, and AVM1 cannot load AVM2.

    Here is a page from flex2 docs which explains the different combinations:
    http://livedocs.adobe.com/flex/2/docs/00001801.html

    You might be interested in this article which details some possible solutions: http://www.flashextensions.com/blog/2006/11/14/interfacing-between-flash-8-9-problems-and-solutions/

    Cheers,
    Arul Prasad.

    Like

  2. @Arul: Thanks man. The documentation explains it of course but its not something obvious. The links you sent are interesting though 😉

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

%d bloggers like this: