Created
December 25, 2010 16:57
-
-
Save 9re/754947 to your computer and use it in GitHub Desktop.
publish all the flas in the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use JSON qw/to_json/; | |
use IO::All; | |
use Cwd; | |
my @flas = (); | |
my @tempflas = grep { | |
my $swftest = $_; | |
$swftest =~ s/\.fla/.swf/; | |
!-e $swftest; | |
} glob("*.fla"); | |
my $arr = to_json \@flas; | |
my $pwd = getcwd(); | |
$pwd = "file:///$pwd/"; | |
my $jsfl =<< "_JSFL_"; | |
fl.outputPanel.clear(); | |
var flas = $arr; | |
var len = flas.length; | |
for (var i = 0; i < len; ++i) { | |
var fla = "$pwd" + flas[i]; | |
var swf = fla.replace(".fla", ".swf"); | |
fl.trace(fla + " -> " + swf); | |
fl.openDocument(fla); | |
var doc = fl.getDocumentDOM(); | |
doc.exportSWF(swf, true); | |
doc.close(false); | |
} | |
_JSFL_ | |
io('temp.jsfl') < $jsfl; | |
`temp.jsfl`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment