views:

1755

answers:

11

I'm sick of waiting hours for Flash to publish. .NET / VisualStudio projects are WAAAAY faster - is that only compiling the classes that have changed?

Update: Does the Flash IDE re-encode all your sounds and images every time you publish? Can't it cache them somewhere?

+1  A: 

You could try to split up your application to separate .swf files and then load them from the main movie.

Also it might be worth to look at your environment. Maybe your machine is running out of RAM, you are using an network drive or your hard disk is encrypted.

Also if the application is getting that big, is Flash really the right technology?

Ralf
+1  A: 

It all depends on your project. I know of some animators that use Flash for publishing broadcast content and that usually takes a long time to publish. There's no getting around it for them. Otherwise, if it takes hours to publish an SWF that will be viewed on the web, then you're probably not going about things the right way.

Additionally, a few obvious culprits that immediately increase the time that it takes to compile a SWF are embedded video and embedded sound. The more items the IDE must compress for output (this includes images too), the longer it will take to compile.

Matt W
+1  A: 

You can't make the Flash IDE cache embedded media (but images won't be reencoded if you import PNGs/GIFs and set the compression to lossless in the library). But if it's a web project you should be loading media from external files anyway, so you don't have to preload all data before anything shows up on the user's screen. You can either load (or even stream) the media files directly or embed them in a separate SWF and load from there, but I don't recommend the latter as it adds unnecessary complexity.

dain
A: 

When compiling is too slow, I usually strip down the library - read load images (png, jpg) and sound via URLRequest.

Usually the thing that really slows down the compiler is importing illustrator (ai) files.

kajyr
+2  A: 

For me it turned out that I removed the character filter on my text fields. This seems innocuous, but in fact it has to embed every fracking glyph it can which resulted in a huge swf file that took forever to compile! Anyhow, definitely check that - I think a lot of people could easily overlook this.

+1  A: 

If you're even willing to change languages you could use haXe. It compiles to SWF and is incredibly fast at compiling. It's probably not worth it to change to a different language at the point where you have hour long compile times, but look into it when you are starting your next large project.

+3  A: 

In Flash CS4, disabling Warnings Mode speeds up code compilation by about 30% (still quite slow). Strict Mode also, but I'm not sure to what extent.

As for library assets, the optimal speed is achieved by setting JPEGs to "Use imported JPEG data" and PNGs/GIFs as "Loosless PNG/GIF". As for sounds, I'm not 100% sure, but I think that ADPCM/mono-to-stereo/5kHz/2bit was the fastest. The [Embed] tag might also help (it doesn't do any convertion) but it includes quite a bit of Flex code.

And as a tip, in Flash CS4 you can batch select assets in the library and apply settings, so you can easily set the optimal speed settings while on development and then change them for deploy.

Cay
+1  A: 

The compiler is just plain slow in the Flash IDE. I can understand the slowness if you have a lot of images in the library that have to be re-exported, but the compiler is inexplicably slow when only compiling code as well.

For example, I have a super basic Away3d scene that requires five full seconds to compile (no library assets). The exact same code compiles in Flex in less than a second. I don't know what's different between the two compilers, but doing any project with a heavy code base in the Flash IDE is just plain painful. As the project grows you'll have to wait longer and longer.

If you're doing a 3D project or something that requires a lot of code compilation, I recommend doing an Actionscript-only project in Flex/Flash Builder. Maybe CS5 will have a better compiler...

Ryan Hovland
A: 

disable warnings in the Publish Settings > Flash > as3

Julien
+1  A: 

You might want to check your character embedding -- If you accidentally click Embed all characters it could embed 1000s of characters, it would significantly slow down your publishing speed

Roshan
A: 

Wow, this is going to save me so much time. I didn't consider the effect of embedding chars. Jeez, this led to more than a tenfold speedup. Not I just need to find a way to retroactively embed all of my textfields. Still, lots of pain saved where it counts, DEVELOPMENT!

Charlie
In future, consider adding comments like this by clicking "add comment" on an appropriate answer. Cheers (and welcome to S.O.!)
aaaidan