Does anybody know how I would go about automating the creation of flex based swfs from another environment/ web page.
I am able to create all the files I need and load them into a directory structure.
But how do I add a swc (effectively into the Library Path) of the new project and then what routine do I call (and how do I call it) to actually create the swf for the new project using the framework and my files.
I'm not clear on whether you are trying to generate SWFs automatically on your website or attempting to create some kind of automated build server. Either way you would need to install the Flex SDK on your server and call mxmlc in order to compile your source files onto a SWF:
Take a look at the compiler options for how to include source files and swcs. Various mxmlc tutorials and examples can found with Google.
For web-tier compilation, there are a couple of solutions available. One ships with LCDS, and another (beta version) is available here:
For setting up build servers you would typically use a declarative scripting technology such as Ant or Maven and optionally a continuous build tool such as Cruise Control. Google for more.