Exemple #1
0
 function parseContent($tagCode, $content, $opts = array())
 {
     $reader = new IO_Bit();
     $reader->input($content);
     $this->CharacterID = $reader->getUI16LE();
     $this->Bounds = IO_SWF_Type_RECT::parse($reader);
     // ----
     $reader->byteAlign();
     $hasText = $reader->getUIBit();
     $this->WordWrap = $reader->getUIBit();
     $this->Multiline = $reader->getUIBit();
     $this->Password = $reader->getUIBit();
     $this->ReadOnly = $reader->getUIBit();
     $hasTextColor = $reader->getUIBit();
     $hasMaxLength = $reader->getUIBit();
     $hasFont = $reader->getUIBit();
     // ----
     $hasFontClass = $reader->getUIBit();
     $this->AutoSize = $reader->getUIBit();
     $hasLayout = $reader->getUIBit();
     $this->NoSelect = $reader->getUIBit();
     $this->Border = $reader->getUIBit();
     $this->WasStatic = $reader->getUIBit();
     $this->HTML = $reader->getUIBit();
     $this->UseOutlines = $reader->getUIBit();
     if ($hasFont) {
         $this->FontID = $reader->getUI16LE();
     }
     if ($hasFontClass) {
         $this->FontClass = IO_SWF_Type_String::parse($reader);
     }
     if ($hasFont) {
         $this->FontHeight = $reader->getUI16LE();
     }
     if ($hasTextColor) {
         $this->TextColor = IO_SWF_Type_RGBA::parse($reader);
     }
     if ($hasMaxLength) {
         $this->MaxLength = $reader->getUI16LE();
     }
     if ($hasLayout) {
         $this->Align = $reader->getUI8();
         $this->LeftMargin = $reader->getUI16LE();
         $this->RightMargin = $reader->getUI16LE();
         $this->Indent = $reader->getUI16LE();
         $this->Leading = $reader->getSI16LE();
     }
     $this->VariableName = IO_SWF_Type_String::parse($reader);
     if ($hasText) {
         $this->InitialText = IO_SWF_Type_String::parse($reader);
     }
 }
Exemple #2
0
 function parse($swfdata)
 {
     $reader = new IO_Bit();
     $reader->input($swfdata);
     $this->_swfdata = $swfdata;
     /* SWF Header */
     $this->_headers['Signature'] = $reader->getData(3);
     $this->_headers['Version'] = $reader->getUI8();
     $this->_headers['FileLength'] = $reader->getUI32LE();
     if ($this->_headers['Signature'][0] == 'C') {
         // CWS の場合、FileLength の後ろが zlib 圧縮されている
         $uncompressed_data = gzuncompress(substr($swfdata, 8));
         if ($uncompressed_data === false) {
             return false;
         }
         list($byte_offset, $dummy) = $reader->getOffset();
         $reader->setOffset(0, 0);
         $swfdata = $reader->getData($byte_offset) . $uncompressed_data;
         $reader = new IO_Bit();
         $reader->input($swfdata);
         $this->_swfdata = $swfdata;
         $reader->setOffset($byte_offset, 0);
     }
     /* SWF Movie Header */
     $this->_headers['FrameSize'] = IO_SWF_Type_RECT::parse($reader);
     $reader->byteAlign();
     $this->_headers['FrameRate'] = $reader->getUI16LE();
     $this->_headers['FrameCount'] = $reader->getUI16LE();
     list($this->_header_size, $dummy) = $reader->getOffset();
     /* SWF Tags */
     while (true) {
         $swfInfo = array('Version' => $this->_headers['Version']);
         $tag = new IO_SWF_Tag($swfInfo);
         $tag->parse($reader);
         $this->_tags[] = $tag;
         if ($tag->code == 0) {
             // END Tag
             break;
         }
     }
     return true;
 }