2

by using flash cs5 with a huge internal image library (over 300+ small png-files) i need more than 90seconds for each compiling action! the as code is pretty well, also my computer (quad core, 4gigs of ram). i've found out, that by exporting the files to "stage 1" (bild 1 in my screenshot) flash starts to hang around, but i don't know why...

.

how to speed this process up ?

__________________________________________________________________________________________________________________________________________

enter image description here

__________________________________________________________________________________________________________________________________________

my solution did not work:

so i've played around and ended up creating *.as-files for each single bitmap, but the speed-result is the same (maybe 10% - 15% faster than before)...

screenshot

package
{
    import flash.display.*;

    dynamic public class MY_BITMAP_NAME extends BitmapData
    {

        public function MY_BITMAP_NAME(width:int = 500, height:int = 135)
        {
            super(width, height);
            return;
        }

    }
}

i can not work fast enough to debug my project files :-(

mate64
  • 9,876
  • 17
  • 64
  • 96

3 Answers3

9

The solution would be to move your assets inside a precompiled SWC library that you will only recompile when they change.

Building the library:

  • create a new FLA and move in your Bitmaps,
  • each image needs to have a linkage class name and be exported in first frame; you don't have to create an AS class, Flash will generate them,
  • in the publish settings, "Flash" tab, check "Export SWC",
  • this SWC library will be published in the same location as the SWF; in CS4-5 you can't prevent the SWF creation.

Using the library

  • in your main FLA publish settings, "Flash" tab, open the Advanced Actionscript 3 settings dialog,
  • in the "Library path" tab you can add the assets library SWC; make sure the "Link Type" is "Merged into code",
  • SWC content will be available in your main FLA as if they were in the library.

It is worth noting that:

  • you must instantiate these assets by code (ie. new AssetName): they will not appear in your main FLA's Library panel and you can not drop them on the timeline,
  • only assets you explicitly reference in your code will be available at run time; if you are using getDefinitionByName() you must still import the assets somewhere in your code. For instance you can declare an Array containing all your assets classes (ex: var assets:Array = [AssetClass1, AssetClass2,...]).
Philippe
  • 2,621
  • 1
  • 19
  • 20
  • thank you both - i've exported the swc and reimported it to my main-file, unfortunately i can not create any references? don't know what's wrong, my assets.fla seems to be 100% ok - here's a screenshot of my main-file: http://www9.picfront.org/token/RLBe/2011/02/24/1926692.png – mate64 Feb 24 '11 at 09:56
  • ok, by exporting my main-file swf, the swf-size size is 128kb - my assets swc has 950kb, is that normal ? i've not worked with swc's before, but i think it should be imported as part of the main-file swf ? – mate64 Feb 24 '11 at 10:00
  • Recently discovered this way of working. Using a SWC you can also work entirely from within FlashDevelop which I think makes things much easier! Better intellisense , debugging etc.. – Tom Feb 24 '11 at 15:02
  • Note bullet #2: each image needs a linkage name. That will be the class name by which you can reference them in your code. IE a 'new whateverImage()' if 'whateverImage' was the linkage name a bitmap in the swc file. – frankhermes Feb 24 '11 at 16:13
3

if these 300+ images don't change too often, you could create a second .fla, where you only put the images in the library. Then you publish that .fla as a swc file (You can set this in the publish settings).

And you use that swc in your original .fla (that now has no images anymore), where you have your code (using the swc means, in the publish settings -> actionscript settings, you set the swc as a library reference).

This way, Flash only has to compile your code and simply takes the already compiled images from the swc. It then should compile much faster.

ghost23
  • 2,150
  • 1
  • 20
  • 35
0
ctrl+enter, that will compile all things in library and the AS code.
most situation that use just change little things, and then compile it.
it would waste much time that no need to waste.
you can export some thing that would not always be changed to SWC file, and to to publish setting,
add SWC file into your Fla. or move you Fla project to Flash build, compile use less time more than in flash ide.
Last Chance
  • 73
  • 1
  • 7