Wednesday, September 15, 2010

JSFL script - iterates over many flas and create swfs for individual symbols


/*
   script tested with Flash CS5,
   should work with older versions.
 */

function universe() {
    var flaPath = "file:///../new_assets/";
    var outputDirPath = "file:///../../../code/trunk/client/game/city/resources/assets/";
    var flaFiles = FLfile.listFolder(flaPath + "*.fla", "files");
    var numFiles = flaFiles.length;
    for (var i = 0; i < numFiles; i++) {
        var flaFilePath = flaPath + flaFiles[i];
        fl.trace("reading "+flaFilePath);
        var doc = fl.openDocument(flaFilePath);
        var items = doc.library.items;
        var iLen = items.length;
        for (var j = 0; j < iLen; j++) {
            var item = items[j];
            if(item.linkageExportForAS) {
                var outputFilePath = outputDirPath+item.linkageClassName+".swf";
                if(fl.fileExists(outputFilePath)) {
                    fl.trace(outputFilePath + " already Exists, you sweet a*s");
                    //return;
                } else {
                    var tmpDoc = fl.createDocument();
                    tmpDoc.addItem({x:0,y:0},item);
                    tmpDoc.exportSWF(outputFilePath);
                    fl.closeDocument(tmpDoc);
                    //fl.trace("exported "+outputFilePath);
                }
            }
        }
        fl.closeDocument(doc);
    }
}
universe();

Tuesday, September 14, 2010

Dumping information about exported assets of a swf

swfdump.exe -a some.swf | grep -i exports

Merging swfs with swfcombie

swfcombine.exe -a first.swf second.swf -o output.swf

Monday, August 16, 2010

Intellij Idea - pathetic debugging for Flex

Almost two months ago, my company switched to IntelliJ Idea from Flex Builder
for Flex development. I am very sorry to say that it sucks, when it comes to debugging.

Its stack trace for breakpoints is WRONG in 99% cases which makes
it very difficult to debug reliably.

Tuesday, August 3, 2010

IntelliJ Idea - Conditional breakpoints for flex

Update to New version of Intellij Idea
if you haven't already.
it contains few new features : 

including conditional breakpoints for flex.

Help -> Check For Update

preventing firefox crashed in debug mode (flex)

Developing for Flash with Flex?

Breakpoints can trigger Firefox's hang protection. You can disable hang protection by setting dom.ipc.plugins.timeoutSecs to -1. 

See Disable Hang Protection for details. 


in a firefox tab, type about:config

and set

dom.ipc.plugins.timeoutSecs to -1. 


Blog Archive