<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://berniebernie.fr/mediawiki-1.37.1/index.php?action=history&amp;feed=atom&amp;title=Adobe_Animate</id>
	<title>Adobe Animate - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://berniebernie.fr/mediawiki-1.37.1/index.php?action=history&amp;feed=atom&amp;title=Adobe_Animate"/>
	<link rel="alternate" type="text/html" href="https://berniebernie.fr/mediawiki-1.37.1/index.php?title=Adobe_Animate&amp;action=history"/>
	<updated>2026-05-22T19:33:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://berniebernie.fr/mediawiki-1.37.1/index.php?title=Adobe_Animate&amp;diff=887&amp;oldid=prev</id>
		<title>Bernie: /* Export layers to single swf file for AE */</title>
		<link rel="alternate" type="text/html" href="https://berniebernie.fr/mediawiki-1.37.1/index.php?title=Adobe_Animate&amp;diff=887&amp;oldid=prev"/>
		<updated>2025-12-01T09:23:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Export layers to single swf file for AE&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:23, 1 December 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; * FLA_LayersTo_SWF_Files.jsfl&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * JSFL Script to export each layer of an Adobe Animate FLA file main timeline (no sub-symbols).  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * JSFL Script to export each layer of an Adobe Animate FLA file main timeline (no sub-symbols).  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * as a separate SWF file, using padded layer number + layer name as the output filename.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * as a separate SWF file, using padded layer number + layer name as the output filename.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     var timeline = dom.getTimeline();&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     var timeline = dom.getTimeline();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	//&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	var dom = fl.getDocumentDOM();&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	//patch to toogle off invisible layers in publish settings stolen from https://community.adobe.com/t5/animate-discussions/toggle-options-in-publish-settings-with-javascript-code/td-p/9673165&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	var profileXML = dom.exportPublishProfileString(dom.currentPublishProfile);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	// WARNING: This is a hack that does direct string manipulation instead of properly parsing the XML&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	// exclude hidden layers (Flash)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	profileXML = profileXML.replace(/&amp;lt;InvisibleLayer&gt;.&amp;lt;\/InvisibleLayer&gt;/g, &#039;&amp;lt;InvisibleLayer&gt;0&amp;lt;/InvisibleLayer&gt;&#039;);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	// exclude hidden layers (HTML/SVG)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	profileXML = profileXML.replace(/&amp;lt;Property name=&quot;includeHiddenLayers&quot;&gt;.+?&amp;lt;\/Property&gt;/g, &#039;&amp;lt;Property name=&quot;includeHiddenLayers&quot;&gt;false&amp;lt;/Property&gt;&#039;);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	// JPEG quality&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	profileXML = profileXML.replace(/&amp;lt;Quality&gt;.+?&amp;lt;\/Quality&gt;/g, &#039;&amp;lt;Quality&gt;100&amp;lt;/Quality&gt;&#039;);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	// apply updated profile&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	dom.importPublishProfileString(profileXML);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     // Get document path and file name (without extension)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     // Get document path and file name (without extension)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     var flaPath = dom.path;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     var flaPath = dom.path;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l69&quot;&gt;Line 69:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 84:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if(layersVisibility[i] &amp;amp;&amp;amp; currentLayer.layerType != &amp;#039;guide&amp;#039;){&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if(layersVisibility[i] &amp;amp;&amp;amp; currentLayer.layerType != &amp;#039;guide&amp;#039;){&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			fl.trace(currentLayer.parentLayer)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;//&lt;/ins&gt;fl.trace(currentLayer.parentLayer)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			// Make only the current layer visible&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			// Make only the current layer visible&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			currentLayer.visible = true;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			currentLayer.visible = true;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bernie</name></author>
	</entry>
	<entry>
		<id>https://berniebernie.fr/mediawiki-1.37.1/index.php?title=Adobe_Animate&amp;diff=886&amp;oldid=prev</id>
		<title>Bernie: Created page with &quot;=== Export layers to single swf file for AE === /!\ Make sure in the publish settings, swf &gt; advanced settings &gt; &quot;Include hiden layers&quot; is turned OFF before launching the jsfl file &lt;pre&gt; /*  * FLA_LayersTo_SWF_Files.jsfl  * JSFL Script to export each layer of an Adobe Animate FLA file main timeline (no sub-symbols).   * as a separate SWF file, using padded layer number + layer name as the output filename.  * Some error checking.  * Hidden and guide layers will be skipped...&quot;</title>
		<link rel="alternate" type="text/html" href="https://berniebernie.fr/mediawiki-1.37.1/index.php?title=Adobe_Animate&amp;diff=886&amp;oldid=prev"/>
		<updated>2025-11-28T17:31:03Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=== Export layers to single swf file for AE === /!\ Make sure in the publish settings, swf &amp;gt; advanced settings &amp;gt; &amp;quot;Include hiden layers&amp;quot; is turned OFF before launching the jsfl file &amp;lt;pre&amp;gt; /*  * FLA_LayersTo_SWF_Files.jsfl  * JSFL Script to export each layer of an Adobe Animate FLA file main timeline (no sub-symbols).   * as a separate SWF file, using padded layer number + layer name as the output filename.  * Some error checking.  * Hidden and guide layers will be skipped...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Export layers to single swf file for AE ===&lt;br /&gt;
/!\ Make sure in the publish settings, swf &amp;gt; advanced settings &amp;gt; &amp;quot;Include hiden layers&amp;quot; is turned OFF before launching the jsfl file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * FLA_LayersTo_SWF_Files.jsfl&lt;br /&gt;
 * JSFL Script to export each layer of an Adobe Animate FLA file main timeline (no sub-symbols). &lt;br /&gt;
 * as a separate SWF file, using padded layer number + layer name as the output filename.&lt;br /&gt;
 * Some error checking.&lt;br /&gt;
 * Hidden and guide layers will be skipped. Masks should be broken to filled shapes.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// Check if a document is open&lt;br /&gt;
if (fl.getDocumentDOM() == null) {&lt;br /&gt;
    fl.trace(&amp;#039;Error: Please open an Adobe Animate (FLA) file.&amp;#039;);&lt;br /&gt;
} else {&lt;br /&gt;
    var dom = fl.getDocumentDOM();&lt;br /&gt;
    var timeline = dom.getTimeline();&lt;br /&gt;
    &lt;br /&gt;
    // Get document path and file name (without extension)&lt;br /&gt;
    var flaPath = dom.path;&lt;br /&gt;
    var flaName = dom.name.substring(0, dom.name.lastIndexOf(&amp;#039;.&amp;#039;));&lt;br /&gt;
	var flaFolder = flaPath.match(/(.*)[\/\\]/)[1]||&amp;#039;&amp;#039;;&lt;br /&gt;
	&lt;br /&gt;
	//horrible flash oddity. Barf. tested on windows, not macos&lt;br /&gt;
	var flaFolderURI = &amp;#039;file:///&amp;#039; + flaFolder.replace(/\\/g, &amp;#039;/&amp;#039;).split(&amp;#039;:&amp;#039;).join(&amp;#039;|&amp;#039;).split(&amp;#039; &amp;#039;).join(&amp;#039;%20&amp;#039;);&lt;br /&gt;
    &lt;br /&gt;
    // Construct the path for the &amp;#039;export&amp;#039; folder&lt;br /&gt;
    // The folder will be next to the FLA file&lt;br /&gt;
    var exportFolderPath = flaFolderURI + &amp;#039;/EXPORT&amp;#039;;&lt;br /&gt;
	&lt;br /&gt;
	// Create folder if it doesn&amp;#039;t exists. Error out if it doesn&amp;#039;t work.&lt;br /&gt;
	if(!FLfile.exists(exportFolderPath) &amp;amp;&amp;amp; !FLfile.createFolder(exportFolderPath)){&lt;br /&gt;
		throw new Error(&amp;#039;Cannot write folder: &amp;#039;+exportFolderPath);&lt;br /&gt;
	}else{&lt;br /&gt;
		fl.trace(&amp;#039; --- Exporting to &amp;#039; + flaFolder + &amp;#039;/EXPORT&amp;#039;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Array of all layers in the current timeline&lt;br /&gt;
    var layers = timeline.layers;&lt;br /&gt;
    var totalLayers = layers.length;&lt;br /&gt;
    &lt;br /&gt;
    // Determine padding length (e.g., 2 for up to 99 layers, 3 for up to 999, 2 minimum)&lt;br /&gt;
    var paddingLength = Math.max(2,totalLayers.toString().length);&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
	// Let&amp;#039;s store the visibility of each layer, then hide all of them. Skip visibility of mask layers.&lt;br /&gt;
	var layersVisibility = {};&lt;br /&gt;
	var layersMask = {};&lt;br /&gt;
    for (var i = 0; i &amp;lt; totalLayers; i++) {&lt;br /&gt;
		var currentLayer = layers[i];  &lt;br /&gt;
		layersVisibility[i] = currentLayer.visible;&lt;br /&gt;
		if(currentLayer.layerType == &amp;quot;mask&amp;quot;){&lt;br /&gt;
			layersMask[i] = true;&lt;br /&gt;
		}else{&lt;br /&gt;
			currentLayer.visible = false;&lt;br /&gt;
			layersMask[i] = false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Loop through all layers&lt;br /&gt;
    for (var i = 0; i &amp;lt; totalLayers; i++) {&lt;br /&gt;
        var currentLayer = layers[i];  &lt;br /&gt;
        &lt;br /&gt;
		// Only proceed if: &lt;br /&gt;
		//	- layer is initially visible&lt;br /&gt;
		//	- layer is not a guide layer&lt;br /&gt;
		//  - layer is not a locked masked layer&lt;br /&gt;
		&lt;br /&gt;
		if(layersVisibility[i] &amp;amp;&amp;amp; currentLayer.layerType != &amp;#039;guide&amp;#039;){&lt;br /&gt;
			fl.trace(currentLayer.parentLayer)&lt;br /&gt;
			// Make only the current layer visible&lt;br /&gt;
			currentLayer.visible = true;&lt;br /&gt;
			&lt;br /&gt;
			// --- 2. Filename Construction ---&lt;br /&gt;
			&lt;br /&gt;
			// Calculate layer index (1-based). padStart doesn&amp;#039;t seem to work, here&amp;#039;s a workaround for padding, hopefully your file should have less than 10000 layers....&lt;br /&gt;
			var layerIndex = i + 1;&lt;br /&gt;
			layerIndex =  &amp;quot;00000&amp;quot;+layerIndex.toString();&lt;br /&gt;
			layerIndex = layerIndex.slice(-paddingLength);&lt;br /&gt;
&lt;br /&gt;
			// Clean up the layer name to be file-system friendly (remove spaces and special chars)&lt;br /&gt;
			// Replacing non-alphanumeric/hyphen/underscore with an underscore&lt;br /&gt;
			var cleanLayerName = currentLayer.name.replace(/[^a-zA-Z0-9_-]/g, &amp;#039;_&amp;#039;);&lt;br /&gt;
			&lt;br /&gt;
			// Construct the full output filename&lt;br /&gt;
			var outputFileName = layerIndex + &amp;#039;_&amp;#039; + cleanLayerName + &amp;#039;.swf&amp;#039;;&lt;br /&gt;
			var outputFilePath = exportFolderPath + &amp;#039;/&amp;#039; +outputFileName;&lt;br /&gt;
			&lt;br /&gt;
			// --- 3. Export ---&lt;br /&gt;
			&lt;br /&gt;
			// Export the current frame/selection as SWF&lt;br /&gt;
			// The exportSWF method exports based on the current visible state of the layers&lt;br /&gt;
			var success = dom.exportSWF(outputFilePath, false); // &amp;#039;false&amp;#039; means export all frames, which is usually correct for layer-based export&lt;br /&gt;
			&lt;br /&gt;
			if (success) {&lt;br /&gt;
				fl.trace(&amp;quot;✅ Exported: &amp;quot; + outputFileName);&lt;br /&gt;
			} else {&lt;br /&gt;
				fl.trace(&amp;quot;❌ Failed to export: &amp;quot; + outputFileName);&lt;br /&gt;
			}&lt;br /&gt;
			&lt;br /&gt;
			//re-hide layer&lt;br /&gt;
			currentLayer.visible = false;&lt;br /&gt;
		}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // --- 4. Cleanup ---&lt;br /&gt;
    &lt;br /&gt;
    // Restore all layers to be visible at the end&lt;br /&gt;
    for (var i = 0; i &amp;lt; totalLayers; i++) {&lt;br /&gt;
        timeline.layers[i].visible = layersVisibility[i];&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Select the first frame and first layer for a clean exit state&lt;br /&gt;
    timeline.currentFrame = 0;&lt;br /&gt;
    timeline.currentLayer = 0;&lt;br /&gt;
    &lt;br /&gt;
    fl.trace(&amp;quot;--- Layer Export Complete! ---&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bernie</name></author>
	</entry>
</feed>