views:

332

answers:

2

I'm building my first website with AS3, and I'm using Flash Builder 4 to create/edit my AS classes. I have two .fla files (preloader.fla and portfolio.fla) which I both published as .swc and loaded them into my ActionScript project in FB4 (build path). When I hit debug, FB4 automatically generates a .SWF in bin-debug folder called Preloader.swf, but in my Preloader.as I have

new URLRequest("Portfolio.swf");

and this Portfolio.swf isn't being generated by itself. Now the real question; how can I tell FB4 to automatically create both .SWF files for me? Or isn't that possible, any workaround then?

Thanks.

A: 

I am not sure about whether FB4 can generate/compile an SWF, but it might be worth giving us an indication of what you want to achieve by doing that. It may be that a more framework based system could be built to operate based on the external data/assets loaded? I dont really want to use the term CMS, but a back-end content/configuration that can set up the framework as required?

Mark Redman
A CMS is really not what I'm looking for. I will load XML later, but for now I just want to test if my preloader works. The only thing I want to achieve is when I debug, that the preloader opens and then it loads my actual content (Portfolio.swf). The Portfolio.swf has to refresh everytime I edit something in my Portfolio.as file, like I'm doing now every time I debug my Preloader.as, the Preloader.swf file gets compiled again. Sorry for the weird explanation, it's the best way I can explain.Thanks!
Nick
Thats why I didnt want to use the term CMS as I realised my comment would be easily dismissed...
Mark Redman
I am not sure what you're saying now? If you have 2 swf files, these will need to be compiled generated individually? Am I missing something? Sorry am confused now.
Mark Redman
My Portfolio.swf has a document class of Portfolio.as and my Preloader.swf = Preloader.as. When I debug my project, Preloader.swf is executed and it tries to load my Portfolio.swf, but this one isn't created. For some reason, when I edit something in Portfolio.as, e.g. I change a trace, it still shows my old traces. When I open the .fla in Flash however and then publish the .swf, it works. So, how can I tell Flex to compile both SWF's when I hit debug? I think I did something wrong, because I think you don't need to compile the SWF over and over again if you change something in a class.
Nick
A: 

You cannot use Flash Builder to compile FLA files. Only Flash Pro CS3/CS4/etc can compile FLA files. They are two separate IDE's meant for building two separate types of applications.

There is a hack you can use so that when you hit 'compile' in Flash Builder, it will automatically open Flash Pro CS4 and compile your FLA for you, but this is really only a workaround, and doesn't save you much. Here are two sites talking about this method:

(PS: In case you didn't know, 'Flex Builder 3' is the old version of 'Flash Builder 4'. They renamed it, but it's the same product. 'Flash Pro CS5/CS4/CS3/8/MX2004/MX' is the separate product that works with FLA's.)

davr