views:

329

answers:

2

Hello, we are two people working on a Flash application.

I work on some ActionScript 3 code, which I compile to a .swc file using the Flex SDK on Linux. My colleague uses the file as a library for his .fla file in the Flash IDE, uses my code in his scripts, creates MovieClip and Sound objects with the classes it provides, and builds the final .swf file from there, with everything linked in.

We would like to link the flex-compiled code as a runtime shared library, so I can substitute a new version of my classes and see the result without going through the Flash IDE.

Is what we're trying to achieve possible? If so, any idea what we might be doing wrong? (see below)

We use the Flex SDK version 3.4.0.9271 and Flash CS4 10.0.2.

Using the .swc as a static library works fine. However, as soon as we move it from the "Library path" tab to the "External library path" tab in the "ActionScript 3.0 advanced settings", the applet stops working. We have also tried to specify a URL for the .swc file in the "Shared library properties" from the "Library" window, with no effect.

(Please forgive the back-translated menu names, feel free to correct me.)

The ActionScript code is compiled with the following command-line (there are classes from three other packages):

acompc -output=engine.swc -compiler.source-path=.
       -include-classes=lib.room.TransientLoc,lib.room.State,...

Thanks for any suggestion in advance,

+1  A: 

Does Flash CS4 IDE support RSL? I thought it was a mechanism that was only available in Flex. You may want to compile your Flex Builder code into a swf, and import the swf into the CS4 code before you do anything else in the application. This way your classes are available at runtime but you can import a new swf without recompiling the Flash IDE stuff.

Tim B.
RSL does seem available in flash, but we didn't manage to get it working and ended up hacking a solution around with a UIMovieClip (from the flex kit for flash) and a trivial flex application. I'll post an answer when we find a better way (or when we admit we won't..)
Jérémie Koenig
+1  A: 

Note that external-library-path only tells the linker to externalize all symbols found in that SWC, it doesn't actually tell it where the RSL is. You said that you provided a URL for the SWC, which isn't enough; you need to extract out the SWF that is inside the SWC in order to use it. This is all stuff that mxmlc/Flex Builder handles for you behind the scenes, but since you're linking using Flash, you'll need to do a few things manually.

Jolly Roger
Thanks, I'll give it a try.
Jérémie Koenig