## Class SwfCompiler

(line 23)

## Description

Located in File: /SwfCompiler.php

## Class Variables

Summary:
mixed $endian
mixed $stack

#### $endian = NULL (line 26)

#### Data type : mixed

#### $stack = '' (line 25)

#### Data type : mixed

## Class Constants

Summary:

## Method Detail

Summary:
SwfCompiler SwfCompiler ()
string arrayToBytecode ( $arr)
string booleanToBytecode ( $bool)
string dataToBytecode (any $data)
void debug ( $str)
string doubleToBytecode (double $f)
void getAllowDomainBytecode ( $url)
string getIntAsHex (integer $int, [integer $numBytes = 1])
void getStringLengthInBytesHex ( $strInHex, $numBytes)
void getVarDump ([ $mixed = null])
string hexstr ( $hexstr)
string integerToBytecode (integer $int, integer 1)
void makeLittleEndian ( $str)
void microtime_float ()
void objectToArray ([ $data = ''])
void prettyHex ( $h)
string strhex ( $string)
string stringToBytecode (string $str)
void writeSwf (Data $data, [ $debug = false], [ $compressionLevel = 4], [ $url = ''])

#### Constructor SwfCompiler (line 28)

#### SwfCompiler SwfCompiler( )

#### Info

#### Method arrayToBytecode (line 159)

#### string arrayToBytecode( $arr)

##### Converts the passed array to SWF bytecode.

#### Parameters

- $arr:

#### Info

- return - SWF bytecode.
- author - Aral Balkan

#### Method booleanToBytecode (line 423)

#### string booleanToBytecode( $bool)

##### Converts the passed boolean to SWF bytecode.

#### Parameters

- $bool:

#### Info

- return - Boolean as SWF bytecode.
- author - Aral Balkan

#### Method dataToBytecode (line 102)

#### string dataToBytecode( any $data)

##### Parses the given data structure (any type) and returns SWF bytecode.

#### Parameters

- any $data: A PHP data structure

#### Info

- return - Swf bytecode representation of the data structure.
- author - Aral Balkan

#### Method debug (line 667)

#### void debug( $str)

#### Parameters

- $str:

#### Info

#### Method doubleToBytecode (line 390)

#### string doubleToBytecode( double $f)

##### Converts a double to its IEEE 754 representation (little-endian)

Modified from Chung Leong's function. (http://www.thescripts.com/forum/thread9237.html.)

TODO: Works on 5.1.2 for me (OS X 10.4.9, Intel Core Duo, MAMP 1.2.1) but waiting for report back from Alex Skinner for whom it is not working. Weird!

#### Parameters

- double $f: A PHP double.

#### Info

- return - Little-endian Flash double in hex (variation on IEEE 754).
- author - Aral Balkan

#### Method getAllowDomainBytecode (line 544)

#### void getAllowDomainBytecode( $url)

#### Parameters

- $url:

#### Info

#### Method getIntAsHex (line 596)

#### string getIntAsHex( integer $int, [integer $numBytes = 1])

##### Returns the hexadecimal representation of the passed integer, padded to $numBytes bytes in little-endian.

#### Parameters

- integer $int: Number to convert to hex byte representation.
- integer $numBytes: Number of bytes to pad to.

#### Info

- return - Integer as hex string.
- author - Aral Balkan

#### Method getStringLengthInBytesHex (line 576)

#### void getStringLengthInBytesHex( $strInHex, $numBytes)

##### Helper methods. (For data type conversions, formatting, etc.)

#### Parameters

- $strInHex:
- $numBytes:

#### Info

#### Method getVarDump (line 62)

#### void getVarDump( [ $mixed = null])

#### Parameters

- $mixed:

#### Info

#### Method hexstr (line 688)

#### string hexstr( $hexstr)

##### Converts a string of hexadecimal values to a string of ASCII characters.

#### Parameters

- $hexstr:

#### Info

- return - String with ASCII characters
- link - http://www.pgregg.com/projects/php/code/hexstr.phps
- author - Paul Gregg <pgregg@pgregg.com>

#### Method integerToBytecode (line 370)

#### string integerToBytecode( integer $int, integer 1)

##### Converts the passed integer to bytecode, padding it to $numBytes bytes in little-endian.

#### Parameters

- integer 1: Number of bytes to pad to.
- integer $int: Number to convert to hex byte representation.

#### Info

- return - Integer as hex string.
- author - Aral Balkan

#### Method makeLittleEndian (line 609)

#### void makeLittleEndian( $str)

#### Parameters

- $str:

#### Info

#### Method microtime_float (line 733)

#### void microtime_float( )

#### Info

#### Method objectToArray (line 77)

#### void objectToArray( [ $data = ''])

##### Converts the passed object to arrays.

#### Parameters

- $data:

#### Info

- author - Aral Balkan

#### Method prettyHex (line 638)

#### void prettyHex( $h)

#### Parameters

- $h:

#### Info

#### Method strhex (line 704)

#### string strhex( $string)

##### Converts a string of ASCII characters to a string of hexadecimal byte values.

#### Parameters

- $string:

#### Info

- return - String with ASCII characters
- link - http://www.pgregg.com/projects/php/code/hexstr.phps
- author - Paul Gregg <pgregg@pgregg.com>
- author - Aral Balkan (added PHP4 bug fix)

#### Method stringToBytecode (line 353)

#### string stringToBytecode( string $str)

##### Converts the passed string to hex and returns the correct SWF bytecode for it.

#### Parameters

- string $str: The string to convert to bytecode.

#### Info

- return - SWF bytecode for the passed string
- author - Aral Balkan

#### Method writeSwf (line 439)

#### void writeSwf( Data $data, [ $debug = false], [ $compressionLevel = 4], [ $url = ''])

##### Wraps the SWF buffer in a doAction block, wraps that with the SWF Header and the SWF footer (set variable, show frame, end SWF) and writes out the SWF.

#### Parameters

- Data $data: to write out as a SWF.
- $debug:
- $compressionLevel:
- $url:

#### Info

- author - Aral Balkan

## Inherited Variables

### Inherited Class Variable Summary

## Inherited Methods

### Inherited Method Summary

Documentation generated on Fri, 06 Jul 2007 19:54:52 +0100 by phpDocumentor 1.3.1