mikrokosmos
[ class tree: mikrokosmos ] [ index: mikrokosmos ] [ all elements ]

Procedural File: mk_lib_swf.php

Source Location: /lib/mk_lib_swf.php



Page Details:



Tags:

filesource:  Source Code for this file








bin2dec [line 429]

void bin2dec( mixed $buf)

converts "binary string" to signed integer



[ Top ]



boundBits [line 168]

void boundBits( mixed $num)

parameter: number

return bits needed to write




[ Top ]



count_bit [line 173]

void count_bit( mixed $nmb, [mixed $bit = false])

count zeroes or one in a given number



[ Top ]



find_minBits [line 147]

void find_minBits( mixed $nmbAr, [mixed $inTwips = true])

parameter: number

converts in twips and return minimun number of bits needed to write




[ Top ]



fp_binStr_float [line 372]

void fp_binStr_float( mixed $fpStr, [mixed $precision = 4], [mixed $fp = 16])

converts a string representing binary 16.16 fixed point

to float




[ Top ]



fp_find_minBits [line 397]

void fp_find_minBits( mixed $fpAr)

find minBits for fp 16.16 values

these valued are not related to twips so inTwips flag is not used




[ Top ]



fp_value2bin [line 342]

void fp_value2bin( mixed $fv, [mixed $minBits = 32])

converts a float to 16.16 fixed point value



[ Top ]



get_binData [line 470]

void get_binData( mixed $binStr, [mixed $requirePad = false])

converts a "binary" string whose bit is represented a "1" or "0"

to a binary data




[ Top ]



get_binData_string [line 455]

void get_binData_string( mixed $buf)

converts a raw binData to "binary" string

each bit is represented as "1" or "0"




[ Top ]



get_global_swfVersion [line 492]

void get_global_swfVersion( )



[ Top ]



get_pad [line 485]

void get_pad( mixed $nBits)

private:

compute padding bits from a given nBits return a padding "0" string




[ Top ]



get_tagID [line 127]

void get_tagID( mixed $tagName)

accept tag name

return a valid tag id




[ Top ]



get_tagName [line 113]

void get_tagName( mixed $tagID)

accept tag id and

return a valid tag name, check if tag id is supported




[ Top ]



has_itemID [line 95]

void has_itemID( mixed $tagID)

returns true | false if a certain tag

has item ID




[ Top ]



isnegative [line 449]

void isnegative( mixed $binStr)

return true | false

if given binary string starts with "1";




[ Top ]



is_supported_tag [line 84]

void is_supported_tag( mixed $tagID)

verify if tag i supported by passing tag id (decimal)



[ Top ]



nmb2twip [line 190]

void nmb2twip( mixed $nmb)

converts number to twip



[ Top ]



read_buttonRecord_data [line 1382]

void read_buttonRecord_data( mixed $buf, [mixed $btType = BUTTON])

reads data

returns an associative array with BUTTONRECORDS fields




[ Top ]



read_color_data [line 959]

void read_color_data( mixed $buf, [mixed $dsType = SHAPE])

reads data

returns an associative array with these fields: red, green, blue, [alpha]




[ Top ]



read_cxform_data [line 980]

void read_cxform_data( mixed $buf)

reads data (CXFORM structure)

returns an associative array with these fields hasAddTerms, hasMultTerms, nBits, redMultTerm, greenMultTerm, blueMultTerm, redAddTerm, greenAddTerm, blueAddTerm




[ Top ]



read_cxform_with_alpha_data [line 1034]

void read_cxform_with_alpha_data( [mixed $buf = ""])

reads data (CXFORMWITHALPHA structure)

returns an associative array with these fields hasAddTerms, hasMultTerms, nBits, redMultTerm, greenMultTerm, blueMultTerm, alphaMultTerm, redAddTerm, greenAddTerm, blueAddTerm, alphaAddTerm




[ Top ]



read_defineButtonSound_data [line 1427]

void read_defineButtonSound_data( [mixed $tagData = ""])

reads data

fill an associative array with defineButtonSound fields




[ Top ]



read_defineButton_data [line 1349]

void read_defineButton_data( [mixed $tagData = ""])

reads data

returns an associative array with BUTTON2 field data before BUTTONRECORD block data




[ Top ]



read_exportAssets_data [line 1286]

void read_exportAssets_data( mixed $tagData)

reads data

fills and returns exportAssets (movieclip with linkage) fields




[ Top ]



read_fileAttributes_data [line 1313]

void read_fileAttributes_data( mixed $tagData)

reads data

returns an associative array with FileAttributes tag data from a give binary data




[ Top ]



read_filterList_data [line 1468]

void read_filterList_data( [mixed $buf = ""])

reads data

fill an associative array with FILTERLIST fields




[ Top ]



read_filter_data [line 1491]

void read_filter_data( [mixed $buf = ""])



[ Top ]



read_frameLabel_data [line 1257]

void read_frameLabel_data( mixed $tagData)

reads data

returns the name label




[ Top ]



read_matrix_data [line 872]

void read_matrix_data( mixed $buf)

fill and return an array

containing MATRIX fields from a given byte buffer




[ Top ]



read_metaData_data [line 1335]

void read_metaData_data( mixed $tagData)

reads data

returns a string containing metadata notice: metadata is an xml instance content




[ Top ]



read_movieClip_data [line 1238]

void read_movieClip_data( mixed $tagData)

reads data

returns an associative array with these fields: spriteID, frameCount, controlTags




[ Top ]



read_placeObject2_data [line 1119]

void read_placeObject2_data( mixed $buf)

reads data fill an associative array with these fields

pfHasClipActions pfHasClipDepth pfHasName pfHasRatio pfHasColorTransform pfHasMatrix pfHasCharacter pfMove

depth characterId / itemID matrix colorTransform ratio name clipDepth clipActions

this is a complex object, refer to swf file format for further info




[ Top ]



read_placeObject2_flags [line 1185]

void read_placeObject2_flags( mixed $poFlags)

reads data

returns an associative array with placeObjec2 flags




[ Top ]



read_protect_data [line 1273]

void read_protect_data( mixed $tagData)

reads data

return the only one field in protect tag MD5password




[ Top ]



read_rect_data [line 816]

void read_rect_data( [mixed $buf = ""])

fill and return an array

containing RECT fields from a given byte buffer




[ Top ]



read_removeObject2_data [line 1206]

void read_removeObject2_data( mixed $tagData)

reads data

returns the only one removeOject2 field: depth




[ Top ]



read_setBackgroundColor_data [line 1219]

void read_setBackgroundColor_data( mixed $tagData)

reads data

fills and returns an associative array with color fiels




[ Top ]



read_swf_string [line 854]

void read_swf_string( mixed $buf, [mixed $fixSlashes = false])

reads data

returns a string, strip away null-termination char




[ Top ]



read_tag_header_data [line 760]

void read_tag_header_data( mixed $buf, [mixed $offsetPosition = -1])

read rawdata

returns an array containing these fields: tagID -> tag code id tagLength -> body length itemID -> item id, even if data does non contains tagOffset -> used to check short/long tag header tagType -> tag description




[ Top ]



set_global_swfVersion [line 488]

void set_global_swfVersion( [mixed $swfVersion = 6])



[ Top ]



si8dec [line 304]

void si8dec( mixed $binSI8)

converts 1 byte data to signed number;



[ Top ]



si16dec [line 310]

void si16dec( mixed $binSI16)

converts 2 bytes little-endian data to signed number;



[ Top ]



si32dec [line 315]

void si32dec( mixed $binSI32)

converts 4 bytes little-endian data to signed number;



[ Top ]



si64double [line 321]

void si64double( mixed $binSI64)

converts 8 bytes little-endian data to signed float;



[ Top ]



snap2twip [line 200]

void snap2twip( mixed $nmb)

"snap" number value to twip, it eases player rendering



[ Top ]



SWFtag_end [line 741]

void SWFtag_end( )

builds an return end tag

place this at end of the movie




[ Top ]



SWFtag_long_header [line 528]

void SWFtag_long_header( mixed $tagID, mixed $tLength)

return long tag header record

more or equal than 63 bytes in length




[ Top ]



SWFtag_short_header [line 520]

void SWFtag_short_header( mixed $tagID, mixed $length)

return short tag header record

less than 63 bytes in length




[ Top ]



swf_bin [line 256]

void swf_bin( mixed $bin)

return a byte value from a binary string



[ Top ]



swf_double [line 225]

void swf_double( mixed $d)



[ Top ]



swf_dword [line 223]

void swf_dword( mixed $w)

parameter: number

return 4 bytes little-endian




[ Top ]



swf_fillStyles [line 575]

void swf_fillStyles( [mixed $fillAr = array()])

parameters: array of fillstyles

builds an return fillstyles record NOTE: this is an obsolete and incomplete function




[ Top ]



swf_init_defineShape [line 560]

void swf_init_defineShape( mixed $shapeID, mixed $tag_length, mixed $xmin, mixed $ymin, mixed $xmax, mixed $ymax)

parameters: they are in dev

starts defining shape




[ Top ]



swf_lineStyles [line 597]

void swf_lineStyles( [mixed $lineWidths = array()], [mixed $lineAr = array()])

parameters: array of linewidths, array of linestyles

builds an return linestyles record NOTE: this is an obsolete and incomplete function




[ Top ]



swf_placeObject2 [line 705]

void swf_placeObject2( [mixed $shapeID = 1], [mixed $depthID = 1], [mixed $placeFlagMove = false], [mixed $placeFlagHasCharacter = true], [mixed $placeFlagHasMatrix = true])

parameters: shape id (number)

builds an return placeobject2 tag




[ Top ]



swf_rect [line 502]

void swf_rect( mixed $x, mixed $y, mixed $wd, mixed $hg)

parameters, coordx, coordy, width, height

return a Flash rectangle structure




[ Top ]



swf_setBgcolor [line 550]

void swf_setBgcolor( mixed $r, mixed $g, mixed $b)

parameters, red, green, blue components > 0 < 255;

build and return a setBackgroundColor tag




[ Top ]



swf_setTailheader [line 537]

void swf_setTailheader( mixed $w, mixed $h, mixed $rate, mixed $frames)

parameters, stageWidth, stageHeight, fps, numFrames

build and return the last part of swf header




[ Top ]



swf_shape_record_rect [line 634]

void swf_shape_record_rect( mixed $x, mixed $y, mixed $wd, mixed $hg)

parameters: x, y, width, height

builds an return shaperecord rect structure




[ Top ]



swf_shape_with_style [line 619]

void swf_shape_with_style( mixed $nFillStyles, mixed $nLineStyles)

parameters: fillstyle record, linestyle record

builds an return shapewithstyle record




[ Top ]



swf_showFrame [line 732]

void swf_showFrame( )

builds an return showframe tag

this is the last tag in every frame




[ Top ]



swf_string [line 250]

void swf_string( mixed $str)

parameter: string

return string + a null byte terminator




[ Top ]



swf_value2bin [line 275]

void swf_value2bin( mixed $v, mixed $bits)

return a binary string with fixed bitlength

from a numeric value




[ Top ]



swf_word [line 217]

void swf_word( mixed $w)

parameter: number

return 2 bytes little-endian




[ Top ]



twip2nmb [line 211]

void twip2nmb( mixed $tw)

converts twips to number



[ Top ]



ui8dec [line 282]

void ui8dec( mixed $binUI8)

converts 1 byte data to number;



[ Top ]



ui16dec [line 290]

void ui16dec( mixed $binUI16)

converts 2 bytes little-endian data to unsigned number;



[ Top ]



ui32dec [line 297]

void ui32dec( mixed $binUI32)

converts 4 bytes little-endian data to unsigned number;



[ Top ]



write_buttonRecord_data [line 1934]

void write_buttonRecord_data( [mixed $brd = array()], [mixed $btType = BUTTON2])

writes data

BUTTONRECORDS compiled binary data




[ Top ]



write_color_data [line 1623]

void write_color_data( mixed $cAr)

write a COLOR structure from a given color array

containing these fields: red, green, blue, [alpha]




[ Top ]



write_cxform_data [line 1646]

void write_cxform_data( mixed $cfd)

write a CXFORM structure data from given associative array

containing these fields: hasAddTerms, hasMultTerms, nBits, redMultTerm, greenMultTerm, blueMultTerm, redAddTerm, greenAddTerm, blueAddTerm




[ Top ]



write_cxform_with_alpha_data [line 1690]

void write_cxform_with_alpha_data( mixed $cwad)

write a CXFORMWITHALPHA structure data from given associative array

containing these fields: hasAddTerms, hasMultTerms, nBits, redMultTerm, greenMultTerm blueMultTerm, alphaMultTerm, redAddTerm, greenAddTerm blueAddTerm, alphaAddTerm




[ Top ]



write_defineButtonSound_data [line 1966]

void write_defineButtonSound_data( [mixed $bsd = array()])

writes data

compile defineButton tagData from a given associative array




[ Top ]



write_defineButton_data [line 1906]

void write_defineButton_data( [mixed $bd = array()])

writes data

compile defineButton or defineButton2 tagData




[ Top ]



write_exportAssets_data [line 1842]

void write_exportAssets_data( [mixed $ead = array()])

writes data

from a given associative array assetCount, number of assets asset items contain fields: id, name




[ Top ]



write_fileAttributes_data [line 1869]

void write_fileAttributes_data( [mixed $faData = array()])

writes data, compile binary tagData

from a given associative array




[ Top ]



write_frameLabel_data [line 1813]

void write_frameLabel_data( [mixed $label = ""], [mixed $hasAnchor = 0])

gets a string and return binary frame label OR named anchor tagdata



[ Top ]



write_matrix_data [line 1555]

void write_matrix_data( mixed $md)

compose bindata from a given array

containing MATRIX fields: [hasScale], [nScaleBits], scaleX, scaleY, [hasRotate], [nRotateBits], rotateSkew0, rotateSkew1, [nTranslateBits], translateX, nTranslateY




[ Top ]



write_metaData_data [line 1892]

void write_metaData_data( [mixed $metadata = ""])

writes data, compile metadata tag froma a given metadata string



[ Top ]



write_placeObject2_data [line 1735]

void write_placeObject2_data( mixed $pod)

pack placeObject2 tagData

from a given associative array containing these fields: ------- please list fields --------




[ Top ]



write_protect_data [line 1826]

void write_protect_data( mixed $MD5password)

gets a string representing MD5 password

returns protect tagdata




[ Top ]



write_rect_data [line 1504]

void write_rect_data( mixed $xmin, mixed $xmax, mixed $ymin, mixed $ymax, [mixed $inTwips = true])

writes data

parameters, xmin, xmax, ymin, ymax return a Flash rectangle structure




[ Top ]



write_removeObject2_data [line 1790]

void write_removeObject2_data( mixed $depth)

returns removeObject2 tagdata from given depth



[ Top ]



write_setBackgroundColor_data [line 1799]

void write_setBackgroundColor_data( mixed $cAr)

gets an associative array

returns setBackgroundColor tagdata




[ Top ]



write_tag_header_data [line 1534]

void write_tag_header_data( mixed $tagHData)

write and returns rawdata

from a given associative array containing: tagID -> tag code id tagSL -> short or long type, if tagLength > 63 long tag header is written tagLength -> body length itemID -> item id, even if data does non contains




[ Top ]



Documentation generated on Tue, 30 May 2006 20:16:11 +0000 by phpDocumentor 1.3.0RC4