views:

21

answers:

1

I have a working AS3 project and it compiles fine to a SWF. I added a new file (via various means: import, drag-drop, new), but it doesn't compile this new file. I'm using Flex Builder 3. I've tried a clean an rebuild. I've tried renaming. It picks up the existing files fine, but not the new one. The project is set to use a HTML wrapper. I see some build files (I think). The new file is in an existing folder and package.

Any idea what could be wrong?

+2  A: 

First, the SWF Compiler will optimize your end code. If you never use a class or create an instance of it anywhere in your application; that code will never be compiled in your application. this is a common occurrence if you're using Flex Remoting with some backend; and a VAlue Object is never instantiated directly, instead you're always returning arrays of it. You'll find you get a lot of "Generic Objects" without the backend object-to- AS3 object translation of the Flex Remoting Gateway.

You didn't specify what type of file you are adding. If it is an ActionScript file it won't automatically be compiled in the swf. You'll have to 'include' it in another class somehow. IF it is an ActionScript class or MXML Component, make sure you are using that class somehow in your code. If it is another file type, such as an image or other asset you'll have to embed that file into your code somehow.

We might be able to offer more help if you were to tell us what type of file is not being added to the final SWC. Also tell us how you can tell.

www.Flextras.com
ya i found out after an hour that i had to use the file. is this an eclipse or a flash nuance?
tom
I'd say it is a Flex compiler nuance; as the compiler optimizes unused classes out of your final application in order to minimize file size. I can't speak for how Flash Pro [or other SWF Building alternatives] work.
www.Flextras.com