ActionScript2 pods in Adobe Connect 8

Let me preface this post with:

The synchronizing of ActionScript 2 Flash files in Adobe Connect 8 is completely unsupported. It’s recommend you use the Flex 3.5 SDK to build custom pods.  This article is meant to show you a way hack you can use to make your AS2 content sync in an Adobe Connect 8 meeting room.  For more information on building a “real” custom pod, download the Collaboration Builder SDK from the Adobe Connect Developer Center.  Stay tuned for a video about building custom pods shortly.

Now for the hack

Again, it’s HIGHLY recommended you upgrade your custom pods to ActionScript 3.0.  If you want to synchronize content with an AS2 custom pod, you need to load it into a Flex Application.  Let’s understand how this works.

A “custom pod” in Connect 8 is nothing more than a Flex Application (currently 3.5 SDK is only supported).  When a custom pod is loaded into the Share Pod in a meeting room, every users gets a copy of the pod.  You keep the pods synchronized using the SyncConnector component in the Collaboration Builder SDK.  For example, if one person drags an image, you send all the other pods a message where to move their image.

In the case of ActionScript 2, the Flex application will communicate with the AS2 file using LocalConnection.  It’s something that allows two SWF files to communicate with each other.  Sync message are still handled with Flex.  The only difference is when Flex receives a sync message it will use LocalConnection to update it’s AS2 SWF:

The Files

You can download the example files here.  These files should be added to a new Flex project. Check out the Collaboration Builder SDK (mentioned above) for more information on starting a new project.

  • ConnectionEmulator.swc/SyncConnector.swc – These are libraries from the Collaboration Builder SDK.
  • ServiceEmulatorApp.swf -This is a SWF file to simulate a Connect Meeting room (for testing)
  • AS2File.fla/AS2File.swf – This is the SWFile I’ m controlling with the custom pod and the source FLA.
  • com.gskinner.utils folder – This folder contains source code libraries for the AS2-to-AS3 communication.  Thanks to Grant Skinner for making a couple nice classes!
  • ConnectAS2Bridge.mxml – Source Flex Application (3.5 sdk)

Download the source code and check out the comments in the code for a overview of how the code is functioning.  Again, don’t be surprised if the syncing is a little flaky.  You’re much better off upgrading to AS3.

UPDATE (This is mentioned in the Connect 8 SDK documentation, but I thought I should add it here too)

After you’ve built/tested your custom pod with the ServiceEmulatorApp, you need to comment out the ConnectionEmulator component in your Flex application.  Then export a release build.  The only two files  you need are the ConnectAS2Bridge.swf and the as2file.swf.  Rename ConnectAS2Bridge.swf to index.swf, zip up the two SWF files and add them into a Share Pod in Connect

 

4 Responses to ActionScript2 pods in Adobe Connect 8

  1. Hi Dustin,

    Your code here is great, I see how your utilizing a localconnection to control the as2 swf. I’m just getting started in connect pro deployment and have a question. Basically I have a flash swf that I simply need to include the guest name from inside. I’ve tried taking the SyncConnector.swc and adding it to my flash included libraries. I’ve then instantiated an instance in my first frame of a flash file in hopes that i could utilize it to communicate with connect pro. Am I headed in the right direction? Is there any way to sync a swf with connect pro with the new SDK outside of including it inside a flex swf and using the localconnection to communicate with it back and forth?

    frank

    • Hey Frank – Connect 8 requires that your custom pod be a Flex application. So even if you only want access to some of the meeting room variable (like userName), you still have to use Flex (or the AS2 hack i’ve added above). Fortunately for you, I’m just about to add a blog post about using Flash to create a custom pod with ActionScript 3.0. It’s a MUCH cleaner solution. I added a video to our videos page as well (it’s the Part 2 video). Refresh your browser in about 20 minutes you’ll see the new post.

  2. Hello Dustin,

    I was just trying your code in adobe flash builder 4.5 and i am not able to test the swf files. I am getting the following error when i try to run multiple instance of ConnectAS2Bridge.html

    ArgumentError: Error #2082: Connect failed because the object is already connected.
    at flash.net::LocalConnection/connect()
    at com.adobe.sync.components::ConnectionEmulator()[C:\bfproject\CollaborationSDK\200\build\sourcecode\src\ConnectionEmulator\src\com\adobe\sync\components\ConnectionEmulator.as:46]
    at ConnectAS2Bridge/_ConnectAS2Bridge_ConnectionEmulator1_i()[C:\CLI\AdobeConnect\ConnectAS2Bridge\src\ConnectAS2Bridge.mxml:55]
    at ConnectAS2Bridge()[C:\CLI\AdobeConnect\ConnectAS2Bridge\src\ConnectAS2Bridge.mxml:55]
    at _ConnectAS2Bridge_mx_managers_SystemManager/create()
    at mx.managers::SystemManager/initializeTopLevelWindow()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:3360]
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:3230]
    at mx.managers::SystemManager/docFrameListener()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:3076]

    Could you please let me know how to fix this bug.

    Thanks,

    Hema

    • @Hema – Typically this happens when the LocalConnection object isn’t shutdown properly in the SWF. The main cause is when you have a runtime error in the SWF and force-close it. If any Flash process is still running, it won’t get reset and this error will pop up the next time you run your app. To fix this, make sure you close any browser and make check your processes to make sure any Flash process isn’t running. Once all processes are shut down, you should be able to test your app again.