Search code examples
javascriptoutputadobecreatejsadobe-animate

Adobe Animate JS Output File


What is the purpose of the JavaScript CreateJS file exported with a sprite sheet from Adobe Animate and how, if possible, can it be used to assist in asset creation with CreateJS?


Solution

  • The JS file that is generated (should have the same name as your FLA) is a representation of your Animate stage, its contents, and any symbols in the library that have a linkage name (so they get exported).

    Think of the JS file as your "library", which includes some meta-data like the images and sounds that need preloading, and any SpriteSheet definitions, since Animate will combine images into SpriteSheets by default.

    From there you can instantiate any of the library and put them on an EaselJS stage. This includes a symbol with the same name as your FLA, which becomes your exportRoot in the exported HTML.

    var exportRoot = new lib.MyFileName(); // The "stage contents"
    stage.addChild(exportRoot);
    
    var item = new lib.MySymbol(); // Some other symbol
    

    To answer your questions specifically about SpriteSheets, the definition in the ss_meta_data contains the SpriteSheet information including image names and frame definitions. All images in the library will point to that element when instantiating images. The library is fairly readable (other than the compressed path instructions, which can be set in the publish settings to show actual commands).

    Let me know if you have any other questions.