function dumpContent($tagCode, $opts = array()) { if (is_null($this->_characterId) === false) { echo "\tCharacterId: " . $this->_characterId . "\n"; } echo "\tMove: " . ($this->_placeFlagMove ? 'true' : 'false') . "\n"; if (is_null($this->_depth) === false) { echo "\tDepth: " . $this->_depth . "\n"; } if (is_null($this->_matrix) === false) { $opts['indent'] = 2; echo "\tMatrix:\n" . IO_SWF_Type_MATRIX::string($this->_matrix, $opts) . "\n"; } if (is_null($this->_colorTransform) === false) { if ($tagCode == 4) { // PlaceObject echo "\tColorTransform: " . IO_SWF_Type_CXFORM::string($this->_colorTransform) . "\n"; } else { echo "\tColorTransform: " . IO_SWF_Type_CXFORMWITHALPHA::string($this->_colorTransform) . "\n"; } } if (is_null($this->_ratio) === false) { echo "\tRatio: " . $this->_ratio . "\n"; } if (is_null($this->_name) === false) { echo "\tName:" . $this->_name . "\n"; } if (is_null($this->_clipDepth) === false) { echo "\tClipDepth:" . $this->_clipDepth . "\n"; } if (is_null($this->_clipActions) === false) { echo "\tClipActions:\n"; echo "\t" . IO_SWF_Type_CLIPACTIONS::string($this->_clipActions, $opts) . "\n"; } }
function dumpContent($tagCode, $opts = array()) { $opts['tagCode'] = $tagCode; echo " CharacterID: {$this->_CharacterID}\n"; echo " TextBounds:\n"; $rect_str = IO_SWF_Type_RECT::string($this->_TextBounds, $opts); echo "\t{$rect_str}\n"; $opts['indent'] = 1; $matrix_str = IO_SWF_Type_MATRIX::string($this->_TextMatrix, $opts); echo " TextMatrix:\n"; echo "{$matrix_str}\n"; echo " GlyphBits: {$this->_GlyphBits} AdvanceBits: {$this->_AdvanceBits}\n"; if (count($this->_TextRecords) == 0) { echo " (TEXTRECORD empty)\n"; } else { echo " TextRecords:\n"; foreach ($this->_TextRecords as $idx => $textRecord) { echo " [{$idx}]:\n"; echo "\t" . IO_SWF_Type_TEXTRECORD::string($textRecord, $opts); } } }
static function string($fillStyle, $opts = array()) { $tagCode = $opts['tagCode']; $isMorph = $tagCode == 46 || $tagCode == 84; $text = ''; $fillStyleType = $fillStyle['FillStyleType']; switch ($fillStyleType) { case 0x0: // solid fill if ($isMorph === false) { $color = $fillStyle['Color']; if ($tagCode < 32) { // 32:DefineShape3 $color_str = IO_SWF_Type_RGB::string($color); } else { $color_str = IO_SWF_Type_RGBA::string($color); } $text .= "solid fill: {$color_str}\n"; } else { $startColor = $fillStyle['StartColor']; $endColor = $fillStyle['EndColor']; $startColor_str = IO_SWF_Type_RGBA::string($startColor); $endColor_str = IO_SWF_Type_RGBA::string($endColor); $text .= "solid fill: {$startColor_str} => {$endColor_str}\n"; } break; case 0x10: // linear gradient fill // linear gradient fill case 0x12: // radial gradient fill if ($fillStyleType == 0x10) { $text .= "linear gradient fill\n"; } else { $text .= "radial gradient fill\n"; } $opts = array('indent' => 2); if ($isMorph === false) { $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['GradientMatrix'], $opts); $text .= $matrix_str . "\n"; $spreadMode = $fillStyle['SpreadMode']; $interpolationMode = $fillStyle['InterpolationMode']; } else { $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['StartGradientMatrix'], $opts); $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['EndGradientMatrix'], $opts); $text .= $matrix_str . "\n"; } foreach ($fillStyle['GradientRecords'] as $gradientRecord) { if ($isMorph === false) { $ratio = $gradientRecord['Ratio']; $color = $gradientRecord['Color']; if ($tagCode < 32) { // 32:DefineShape3 $color_str = IO_SWF_Type_RGB::string($color); } else { $color_str = IO_SWF_Type_RGBA::string($color); } $text .= "\t\tRatio: {$ratio} Color:{$color_str}\n"; } else { $startRatio = $gradientRecord['StartRatio']; $startColorStr = IO_SWF_Type_RGBA::string($gradientRecord['StartColor']); $endRatio = $gradientRecord['EndRatio']; $endColorStr = IO_SWF_Type_RGBA::string($gradientRecord['EndColor']); $text .= "\t\tStart: Ratio:{$startRatio} Color:{$startColorStr} => End: Ratio:{$endRatio} Color:{$endColorStr}\n"; } } break; case 0x40: // repeating bitmap fill // repeating bitmap fill case 0x41: // clipped bitmap fill // clipped bitmap fill case 0x42: // non-smoothed repeating bitmap fill // non-smoothed repeating bitmap fill case 0x43: // non-smoothed clipped bitmap fill $text .= "Bitmap({$fillStyleType}): "; $text .= " BitmapId: " . $fillStyle['BitmapId'] . "\n"; if ($isMorph === false) { $text .= "\tBitmapMatrix:\n"; $opts = array('indent' => 2); $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['BitmapMatrix'], $opts); $text .= $matrix_str . "\n"; } else { $opts = array('indent' => 2); $text .= "\tStartBitmapMatrix:\n"; $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['StartBitmapMatrix'], $opts); $text .= $matrix_str . "\n"; $text .= "\tEndBitmapMatrix:\n"; $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['EndBitmapMatrix'], $opts); $text .= $matrix_str . "\n"; } break; default: $text .= "Unknown FillStyleType({$fillStyleType})\n"; } return $text; }
static function string($buttonrecord, $opts = array()) { $text = ''; $buttonHasBlendMode = $buttonrecord['ButtonHasBlandMode']; $buttonHasFilterList = $buttonrecord['ButtonHasFilterList']; $text .= "HasBlandMode:" . $buttonrecord['ButtonHasBlandMode'] . ' HasFilterList:' . $buttonrecord['ButtonHasFilterList'] . "\n\t\t"; foreach (array('StateHitTest', 'StateDown', 'StateOver', 'StateUp') as $label) { $text .= $label . ':' . $buttonrecord['Button' . $label] . ' '; } $text .= "\n\t\t"; $text .= "CharacterID:{$buttonrecord['CharacterID']} PlaceDepth:{$buttonrecord['PlaceDepth']}"; $text .= "\n"; $opts['indent']++; $text .= IO_SWF_Type_MATRIX::string($buttonrecord['PlaceMatrix'], $opts) . "\n"; if ($opts['tagCode'] == 34) { // DefineButton2 $text .= "\t\tColorTransform:" . IO_SWF_Type_CXFORMWITHALPHA::string($buttonrecord['ColorTransform']) . ' '; } else { $text .= 'ColorTransform:' . IO_SWF_Type_CXFORM::string($buttonrecord['ColorTransform']) . ' '; } if ($opts['tagCode'] == 34 && $opts['Version'] >= 8) { // DefineButton2 & SWF8 later if ($buttonHasFilterList == 1) { $text .= 'FilterList:' . IO_SWF_Type_FILTERLIST::string($buttonrecord['FilterList']) . "\n"; } if ($buttonHasBlendMode == 1) { $text .= 'BlendMode:' . $buttonrecord['BlendMode'] . "\n"; } } return $text; }