Reusing Flash Remoting 2.0 in several .swf

I am making an application using flash mx 2004 and remoting 2.0 that uses several different .swf files (about 30 files, each one with about 8 kb without remoting). This architecture is important since these swf movies are only loaded when needed, and are reused in another projects.

I need to use remoting in every files, so, since it’s remoting 2.0, i have to drag the remotingClasses to the stage of each file. Since remotingClasses is about 10 kb, my movies that once had 8kb, now have 18 kb. Multiplied by 30, my flash application now has 540 kb (and once, it was 240 kb).

I’ve tried to reuse the RemotingClasses, only putting them in the library.swf (shared by all movies), but it didn’t work, since i get actionscript errors when compiling the movies, originated by actionscript 2.0 script typing:

Error Scene=Scene 1, layer=Layer 1, frame=1:Line 5: The class

‘ResultEvent’ could not be loaded.
function echoString_Result(result:ResultEvent)

So, my question is:

  • How can i reuse Remoting 2.0 Classes in every swf file, without adding 10 kb to each of them?..

Thanks for your attention, and sorry for my English. (I’m Portuguese )