Example #1
0
}
$totalSWFObjects = 0;
foreach ($xml->svg as $svg) {
    if ($svg['t'] != 'f') {
        if ($charid != null || $chardepth != null) {
            for ($p = 0; $p <= $totalSWFObjects - 1; $p++) {
                $swf->RemoveObjectFromLayer($charid[$p], $chardepth[$p]);
            }
        }
    }
    foreach ($svg->line as $line) {
        $linefillColor = rgbConvert($line['stroke']);
        $CharacterInfo = $swf->DefineStraightLine($line['x1'] * 20, $height * 20 - $line['y1'] * 20, $line['x2'] * 20, $height * 20 - $line['y2'] * 20, $line['stroke-width'] * 20, false, $linefillColor[0], $linefillColor[1], $linefillColor[2], 0);
        $CharacterDepth = $swf->EasyPlaceObject($CharacterInfo["CharacterID"]);
        $charid[$totalSWFObjects] = $CharacterInfo["CharacterID"];
        $chardepth[$totalSWFObjects] = $CharacterDepth;
        $totalSWFObjects++;
    }
    foreach ($svg->rect as $rect) {
        $rectfillColor = rgbConvert($rect['fill']);
        $rectlineColor = rgbConvert($rect['stroke']);
        $CharacterInfo = $swf->DefineRectangleSolid($rect['x'] * 20, $height * 20 - $rect['y'] * 20, $rect['x'] * 20 + $rect['width'] * 20, $height * 20 - ($rect['y'] * 20 + $rect['height'] * 20), $rect['stroke-width'] * 2, false, true, $rectlineColor[0], $rectlineColor[1], $rectlineColor[2], 255, true, $rectfillColor[0], $rectfillColor[1], $rectfillColor[2], 255);
        $CharacterDepth = $swf->EasyPlaceObject($CharacterInfo["CharacterID"]);
        $charid[$totalSWFObjects] = $CharacterInfo["CharacterID"];
        $chardepth[$totalSWFObjects] = $CharacterDepth;
        $totalSWFObjects++;
    }
    $swf->EndFrame();
}
$swf->EndMovie();
echo $swf->GetMovie();
Example #2
0
        $charid[$totalSWFObjects] = $CharacterInfo["CharacterID"];
        $chardepth[$totalSWFObjects] = $CharacterDepth;
        $totalSWFObjects++;
    }
    foreach ($svg->rect as $rect) {
        $rectfillColor = rgbConvert($rect['fill']);
        $rectlineColor = rgbConvert($rect['stroke']);
        $CharacterInfo = $swf->DefineRectangleSolid($rect['x'] * 20, $height * 20 - $rect['y'] * 20, $rect['x'] * 20 + $rect['width'] * 20, $height * 20 - ($rect['y'] * 20 + $rect['height'] * 20), $rect['stroke-width'] * 20, false, true, $rectlineColor[0], $rectlineColor[1], $rectlineColor[2], 255, true, $rectfillColor[0], $rectfillColor[1], $rectfillColor[2], 255);
        $CharacterDepth = $swf->EasyPlaceObject($CharacterInfo["CharacterID"]);
        $charid[$totalSWFObjects] = $CharacterInfo["CharacterID"];
        $chardepth[$totalSWFObjects] = $CharacterDepth;
        $totalSWFObjects++;
    }
    foreach ($svg->ellipse as $ellipse) {
        $ellipsefillColor = rgbConvert($rect['fill']);
        $ellipselineColor = rgbConvert($rect['stroke']);
        //Problem: Freemovie supports CIRCLES, I use ellipses, so i'll try simply using the y radius
        $CharacterInfo = $swf->DefineCircleSolid(17, $ellipse['cx'] * 20, $height * 20 - $ellipse['cy'] * 20, $ellipse['ry'] * 20, $ellipse['stroke-width'] * 20, false, true, $rectlineColor[0], $ellipselineColor[1], $ellipselineColor[2], 255, true, $ellipsefillColor[0], $ellipsefillColor[1], $ellipsefillColor[2], 255);
        $CharacterDepth = $swf->EasyPlaceObject($CharacterInfo["CharacterID"]);
        $charid[$totalSWFObjects] = $CharacterInfo["CharacterID"];
        $chardepth[$totalSWFObjects] = $CharacterDepth;
        $totalSWFObjects++;
    }
    $swf->EndFrame();
}
$swf->EndMovie();
$type = $_REQUEST['type'];
if ($type == "export") {
    $fileDir = "files";
    if ($_REQUEST['filename'] != null) {
        $SWFFileName = $_REQUEST['filename'];