Home > Flash > Screendump my Stage

Screendump my Stage

November 18th, 2009

Often in bug testing phase or just to show something it’s a tideus work to screendump your screen and it get as well a problem if you are dependent by the transparency.

Wrote a small debug class that takes a screen dump of the stage and puts the file on a server (PHP).

So put this PHP on a server somewhere.

<?php
$png = $GLOBALS["HTTP_RAW_POST_DATA"];
$name = date('Y-m-d H.i.s');
$filename = $name.'.png';
file_put_contents($filename, $png);
?>

<?php
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
$name = date(‘Y-m-d H.i.s’);
$filename = $name.’.png’;
file_put_contents($filename, $jpg);
?>

<?php
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
$name = date(‘Y-m-d H.i.s’);
$filename = $name.’.png’;
file_put_contents($filename, $jpg);
?>

Then you can add this class to you project, required is the adobe core package (http://code.google.com/p/as3corelib/).
Download Screendump.as

To use it first set the URI and stage
Screendump.stage = this.stage;
Screendump.URI = “http://localhost:8888/screendump/dump.php”;

After that whenever you need to take a dump, run
Screendump.takeDump();

Flash , ,

  1. No comments yet.
  1. No trackbacks yet.