1

I am very new to Alchemy and not an expert in using swc to store code(Although I am well aware that it worked for me so far). I want to make sure I understand if Alchemy is the right tool for me in this situation. I want to make a simple script in Alchemy to help make certain 'heavy lifting' in the code lighter and less time consuming and ooze out more performance. The trick is that my colleagues will likely be daunted by the installation process(even though there is a guide). So my question is, if I do take the time to work with Alchemey, can I make my code available to other people that do not use it, for our project?

Hope that makes sense, my instincts (gut feeling) says yes. I simply want to make sure.

AturSams
  • 7,568
  • 18
  • 64
  • 98

2 Answers2

4

Yes, this is exactly what SWCs are for, you can compile your C++ code with FlasCC and expose a simple AS3 API that other people can use by linking your SWC into their project. Download the FlasCC beta and check out the tutorials it comes with that explain this in more detail: http://gaming.adobe.com/technologies/flascc/

Alex Mac
  • 41
  • 3
2

Shortly, the answer is yes.

The point is you can't recompile the SWC into an SWF if you don't use alchemy. What you can do, is download at runtime (using Loader.load with ApplicationDomain.currentDomain) the SWF contained into the SWF (SWC is a simple zip, extract it).

Then, you can freely use the class that's inside, using ApplicationDomain.getDefinition("OneOfYourClass). More about application domain

Since it's at runtime, you won't have to compile Alchemy, thus it should work fine for anyone.

blue112
  • 52,634
  • 3
  • 45
  • 54
  • Does this answer change when using FlasCC, is there any difference? – AturSams Oct 09 '12 at 08:06
  • 1
    Since FlasCC provide valide bytecode, it can be loaded and used at runtime. To know which symbols are exposed into your swf, you can use SWFReader (http://haxer.be/SWFTools/SWFReader3.html) and look for the "Symbol Class" tag. – blue112 Oct 09 '12 at 08:10