Getting AS2 Remoting Classes Into Your MTASC SWF

Just read on the MTASC list the tail end of a long thread about event handlers and scope. We have a lot of new blood getting into Flash, and even the experienced programmers still all need to learn how Flash handles scope in different situations.

As such, the conversation discussed why you use the -mx compiler option for MTASC. Bottom line, it ignores all classes that have a package path starting with “mx”. Since there are a plethora of the Flash MX 2004 v2 component classes that will not compile under MTASC, one uses the -mx option to have MTASC just ignore those classes if you choose to use a pre-compiled SWF. Most people compile in Flash after building their movieclips and artwork, and then use MTASC for the rest of their development cycle, unless they need to add more artwork or movieclips again (unless they are using SWFMill of course).

I had problems doing a FAME only project awhile ago; the AS2 remoting classes would NOT compile into my SWF using MTASC, even when using dependencies, and I couldn’t figure out why. They even had some MX 2004 components in there already, so I was baffled.

After reading that thread today, I figured out that unless Flash MX 2004 puts them there via you compiling in it first, MTASC will NOT add them to the SWF because they fall under the -mx compiler option; don’t put “mx.*” classes in the SWF.

So, instead of using those Remoting Components you can drag into the FLA to force them in, or re-writing the AS2 remoting components to compile in MTASC (thanks Mario! I finally understood your email after 22 days… I know, I’m slow), just compile in Flash first so it puts the classes in the SWF, then you can use that SWF with MTASC.

One Reply to “Getting AS2 Remoting Classes Into Your MTASC SWF”

  1. I came to that problem one time when I compile form Flash IDE and comment the only line in the SWF (a main()).

    Then I recompile without comments and all goes fine.

    Currently I’m having some headaches trying to modularize my application.

    We need a framework where we could preload assets like UIComponents, remoting classes, main core application, xml for menu, css, etc…

    Sometimes Flash is a real pain…

Comments are closed.