<?php
include("sample_utils.php"); // provides some utils and using mk
$swfFN = "sample03.swf"; // swf to read
$mksi = new MKswf_inspector($swfFN); // instantiate sww inspector
$mt = $mksi->fetch_assoc(); // get some data
$fl = $mksi->get_frameList(); // get frames list
$sca = new MKswf_serializer($mt, $fl); // serialize
$mkim = new MKswf_item_grabber($swfFN, 1, IMAGE_ITEM); // grab image items
$bmList = $mkim->get_itemList(); // get items (images) list
// html publishing
$tbl = new MKtable(); // new table object
$tRow =
array();
// an array
foreach($bmList as $bm){ // iterate over images list
$bm->save_image(); // save image
$tRow[0] =
array();
// each item of this array correspond to a cell $ifn = $bm->get_imageFileName(); // get image file name
$str = "<img src=\"" .$imgDir; // wrap into an img html tag
$str .= $ifn ."\" /><br />"; // build image path
$str .= $ifn; // ...
$tRow[0]["cellContent"] = $str; // fill cell
$tbl->add_row($tRow); // add row to table
if($bm->hasAlpha()){ // if image contain alpha data
$tRow[0] =
array();
// ... create new row $bm->save_alpha(); // save alpha data
$aifn = $bm->get_alphaImageFileName(); // get assigned file name to alpha data
$str = "<img src=\"" .$imgDir; // wraps into an img html tag
$str .= $aifn ."\" /><br />"; // ...
$str .= "alpha channel: " .$aifn; // ...
$tRow[0]["cellContent"] = $str; // fill cell
$tbl->add_row($tRow); // add row to table
}
}
// publish data in a table html tag + comment
$str = trace_var($tbl->fetch_html(), "<strong>images saved in: " .SERVER_MKTMP ."</strong>", false, false, true);
?>