Saving the contents of the Flash Output panel to an external file using JSFL

by Peter deHaan on November 29, 2008

in JSFL

The following example shows how you can use JSFL to save the contents of the Flash Output panel to an external file using the fl.outputPanel.save() command.

Full code after the jump.

// JSFL
var OUTPUT_FILE = "file:///c:/outputPanel.txt";
 
var arr = ["PAGEFAULTCOUNT",
           "PEAKWORKINGSETSIZE",
           "WORKINGSETSIZE",
           "QUOTAPEAKPAGEDPOOLUSAGE",
           "QUOTAPAGEDPOOLUSAGE",
           "QUOTAPEAKNONPAGEDPOOLUSAGE",
           "QUOTANONPAGEDPOOLUSAGE",
           "PAGEFILEUSAGE",
           "PEAKPAGEFILEUSAGE"];
 
fl.outputPanel.clear();
for (var i = 0; i < arr.length; i++) {
    fl.trace(i + ") " + arr[i] + ": " + fl.getAppMemoryInfo(i));
}
fl.outputPanel.save(OUTPUT_FILE, false);

Running this JSFL command displays the following information in the Output panel, as well as saving it to the specified file:

0) PAGEFAULTCOUNT: 489076
1) PEAKWORKINGSETSIZE: 177864704
2) WORKINGSETSIZE: 27672576
3) QUOTAPEAKPAGEDPOOLUSAGE: 487204
4) QUOTAPAGEDPOOLUSAGE: 438692
5) QUOTAPEAKNONPAGEDPOOLUSAGE: 32432
6) QUOTANONPAGEDPOOLUSAGE: 30160
7) PAGEFILEUSAGE: 146759680
8) PEAKPAGEFILEUSAGE: 152084480

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Previous post: Prompting the user for information in Flash using JSFL

Next post: Saving and compacting all open documents in Flash using JSFL