PDA

View Full Version : .jar equivalent?


tyrionlannister
08-28-2008, 04:27 PM
Hello,
I am fairly new to Flash and Actionscript, and I am having trouble finding the answer to a basic question. Is there the equivalent of a .jar file for actionscript code? Essentially, I am building a set of classes and interfaces that I want to package and distribute as a binary (no source code), so that another developer can import classes from my package for use in a swf. My code has nothing graphical, sprite, or timeline-related. It is purely for socket communication. Thanks for any help.

senocular
08-28-2008, 04:38 PM
basically SWF. SWCs can also be created for distribution to be used by other developers; they contain a little more meta data and need to be compiled with the project being created. To be imported at runtime, though, a SWF is used.

tyrionlannister
08-28-2008, 06:36 PM
Thank you for your response. Can you direct me to some instructions on how to create the swf that would contain the entire package (from, say, five or six .as files), and how to reference that swf from other Actionscript? Thanks again.

fx.barrett
08-28-2008, 06:48 PM
Thank you for your response. Can you direct me to some instructions on how to create the swf that would contain the entire package (from, say, five or six .as files), and how to reference that swf from other Actionscript? Thanks again.

Once compiled, the .swf already container everything you used... you don't have to specify manually which files to include and which not... the ones you used in the project will be compiled into the .swf file.

You can access a .swf file by loading it into another .swf file with the help of the Loader and/or URLLoader class. I'm not sure what you are trying to do but as a friendly advice: try avoiding multiple .swf files... don't think a Flash project as a Java project because you'll fail... Flash is totally different and it requires a totally different way of thinking.

tyrionlannister
08-28-2008, 07:25 PM
What I am trying to do is this:
I am creating two out of three parts of a client/server application. Part one is the server, which is being written in a native language. Part three (not my part) is a GUI for the client.

Part two is the part I am asking about, and it is a client that will speak to the server and expose a few classes to the GUI that will have simple methods like sendMessage [to the server] and events like MessageEvent.RECEIVED that the GUI should subscribe to. The issue is that the server and the client are proprietary. I cannot give the code for the client to the writer of the GUI (unless that restriction is impossible). In java I would simply write my client, compile it, and jar it, and hand the jar file to the GUI creator, who would then simply add it somewhere convenient to his CLASSPATH and import the package at the top of his code. As you've figured out, I do not know what the equivalent process is for Flash and Actionscript.