Ming (flash)Table of Contents
The SWFAction classIntroductionSWFAction. Class synopsisSWFAction
class SWFAction
{
/* Methods */
__construct
( string
}$script
)DescriptionThe script syntax is based on the C language, but with a lot taken out- the SWF bytecode machine is just too simpleminded to do a lot of things we might like. For instance, we can't implement function calls without a tremendous amount of hackery because the jump bytecode has a hardcoded offset value. No pushing your calling address to the stack and returning- every function would have to know exactly where to return to. So what's left? The compiler recognises the following tokens:
There is no typed data; all values in the SWF action machine are stored as strings. The following functions can be used in expressions:
Additionally, the following commands may be used:
Movie clips (all together now- aka sprites) have properties. You can read all of them (or can you?), you can set some of them, and here they are:
The SWFBitmap classIntroductionSWFBitmap. Class synopsisSWFBitmap
class SWFBitmap
{
/* Methods */
__construct
( mixed
$file
[, mixed $alphafile
] )
float getHeight
( void
)
float getWidth
( void
)
}The SWFButton classIntroductionSWFButton. Class synopsisSWFButton
class SWFButton
{
/* Methods */
void addAction
( SWFAction
$action
, int $flags
)
SWFSoundInstance addASound
( SWFSound
$sound
, int $flags
)
void addShape
( SWFShape
$shape
, int $flags
)
__construct
( void
)
void setAction
( SWFAction
$action
)
void setDown
( SWFShape
$shape
)
void setHit
( SWFShape
$shape
)
void setMenu
( int
$flag
)
void setOver
( SWFShape
$shape
)
void setUp
( SWFShape
}$shape
)The SWFDisplayItem classIntroductionSWFDisplayItem. Class synopsisSWFDisplayItem
class SWFDisplayItem
{
/* Methods */
void addAction
( SWFAction
$action
, int $flags
)
void addColor
( int
$red
, int $green
, int $blue
[, int $a
] )
void endMask
( void
)
float getRot
( void
)
float getX
( void
)
float getXScale
( void
)
float getXSkew
( void
)
float getY
( void
)
float getYScale
( void
)
float getYSkew
( void
)
void move
( float
$dx
, float $dy
)
void moveTo
( float
$x
, float $y
)
void multColor
( float
$red
, float $green
, float $blue
[, float $a
] )
void remove
( void
)
void rotate
( float
$angle
)
void rotateTo
( float
$angle
)
void scale
( float
$dx
, float $dy
)
void scaleTo
( float
$x
[, float $y
] )
void setDepth
( int
$depth
)
void setMaskLevel
( int
$level
)
void setMatrix
( float
$a
, float $b
, float $c
, float $d
, float $x
, float $y
)
void setName
( string
$name
)
void setRatio
( float
$ratio
)
void skewX
( float
$ddegrees
)
void skewXTo
( float
$degrees
)
void skewY
( float
$ddegrees
)
void skewYTo
( float
}$degrees
)The SWFFill classIntroductionThe SWFFill object allows you to transform (scale, skew, rotate) bitmap and gradient fills. swffill objects are created by the SWFShape::addFill method. Class synopsisSWFFill
class SWFFill
{
/* Methods */
void moveTo
( float
$x
, float $y
)
void rotateTo
( float
$angle
)
void scaleTo
( float
$x
[, float $y
] )
void skewXTo
( float
$x
)
void skewYTo
( float
}$y
)The SWFFont classIntroductionThe SWFFont object represent a reference to the font definition, for us with SWFText::setFont and SWFTextField::setFont. Class synopsisSWFFont
class SWFFont
{
/* Methods */
__construct
( string
$filename
)
float getAscent
( void
)
float getDescent
( void
)
float getLeading
( void
)
string getShape
( int
$code
)
float getUTF8Width
( string
$string
)
float getWidth
( string
}$string
)The SWFFontChar classIntroductionSWFFontChar. Class synopsisSWFFontChar
class SWFFontChar
{
/* Methods */
void addChars
( string
$char
)
void addUTF8Chars
( string
}$char
)The SWFGradient classIntroductionSWFGradient. Class synopsisSWFGradient
class SWFGradient
{
/* Methods */
void addEntry
( float
$ratio
, int $red
, int $green
, int $blue
[, int $alpha = 255
] )
__construct
( void
)
}The SWFMorph classIntroductionThe methods here are sort of weird. It would make more sense to just have newSWFMorph(shape1, shape2);, but as things are now, shape2 needs to know that it's the second part of a morph. (This, because it starts writing its output as soon as it gets drawing commands- if it kept its own description of its shapes and wrote on completion this and some other things would be much easier.) Class synopsisSWFMorph
class SWFMorph
{
/* Methods */
__construct
( void
)
SWFShape getShape1
( void
)
SWFShape getShape2
( void
)
}The SWFMovie classIntroductionSWFMovie is a movie object representing an SWF movie. Class synopsisSWFMovie
class SWFMovie
{
/* Methods */
mixed add
( object
$instance
)
void addExport
( SWFCharacter
$char
, string $name
)
mixed addFont
( SWFFont
$font
)
__construct
([ int
$version
] )
SWFSprite importChar
( string
$libswf
, string $name
)
SWFFontChar importFont
( string
$libswf
, string $name
)
void labelFrame
( string
$label
)
void nextFrame
( void
)
int output
([ int
$compression
] )
void remove
( object
$instance
)
int save
( string
$filename
[, int $compression = -1
] )
int saveToFile
( resource
$x
[, int $compression = -1
] )
void setbackground
( int
$red
, int $green
, int $blue
)
void setDimension
( float
$width
, float $height
)
void setFrames
( int
$number
)
void setRate
( float
$rate
)
SWFSoundInstance startSound
( SWFSound
$sound
)
void stopSound
( SWFSound
$sound
)
int streamMP3
( mixed
$mp3file
[, float $skip = 0
] )
void writeExports
( void
)
}The SWFPrebuiltClip classIntroductionSWFPrebuiltClip. Class synopsisSWFPrebuiltClip
class SWFPrebuiltClip
{
/* Methods */
__construct
( mixed
}$file
)The SWFShape classIntroductionSWFShape. Class synopsisSWFShape
class SWFShape
{
/* Methods */
SWFFill addFill
( int
$red
, int $green
, int $blue
[, int $alpha = 255
] )
__construct
( void
)
void drawArc
( float
$r
, float $startAngle
, float $endAngle
)
void drawCircle
( float
$r
)
int drawCubic
( float
$bx
, float $by
, float $cx
, float $cy
, float $dx
, float $dy
)
int drawCubicTo
( float
$bx
, float $by
, float $cx
, float $cy
, float $dx
, float $dy
)
int drawCurve
( float
$controldx
, float $controldy
, float $anchordx
, float $anchordy
[, float $targetdx
], float $targetdy
)
int drawCurveTo
( float
$controlx
, float $controly
, float $anchorx
, float $anchory
[, float $targetx
], float $targety
)
void drawGlyph
( SWFFont
$font
, string $character
[, int $size
] )
void drawLine
( float
$dx
, float $dy
)
void drawLineTo
( float
$x
, float $y
)
void movePen
( float
$dx
, float $dy
)
void movePenTo
( float
$x
, float $y
)
void setLeftFill
( SWFGradient
$fill
)
void setLine
( SWFShape
$shape
)
void setRightFill
( SWFGradient
}$fill
)The SWFSound classIntroductionSWFSound. Class synopsisSWFSound
class SWFSound
{
/* Methods */
__construct
( string
}$filename
[, int $flags = 0
] )The SWFSoundInstance classIntroductionSWFSoundInstance objects are returned by the SWFSprite::startSound and SWFMovie::startSound methods. Class synopsisSWFSoundInstance
class SWFSoundInstance
{
/* Methods */
void loopCount
( int
$point
)
void loopInPoint
( int
$point
)
void loopOutPoint
( int
$point
)
void noMultiple
( void
)
}The SWFSprite classIntroductionAn SWFSprite is also known as a "movie clip", this allows one to create objects which are animated in their own timelines. Hence, the sprite has most of the same methods as the movie. Class synopsisSWFSprite
class SWFSprite
{
/* Methods */
void add
( object
$object
)
__construct
( void
)
void labelFrame
( string
$label
)
void nextFrame
( void
)
void remove
( object
$object
)
void setFrames
( int
$number
)
SWFSoundInstance startSound
( SWFSound
$sount
)
void stopSound
( SWFSound
}$sount
)The SWFText classIntroductionSWFText. Class synopsisSWFText
class SWFText
{
/* Methods */
void addString
( string
$string
)
void addUTF8String
( string
$text
)
__construct
( void
)
float getAscent
( void
)
float getDescent
( void
)
float getLeading
( void
)
float getUTF8Width
( string
$string
)
float getWidth
( string
$string
)
void moveTo
( float
$x
, float $y
)
void setColor
( int
$red
, int $green
, int $blue
[, int $a = 255
] )
void setFont
( SWFFont
$font
)
void setHeight
( float
$height
)
void setSpacing
( float
}$spacing
)The SWFTextField classIntroductionSWFTextField. Class synopsisSWFTextField
class SWFTextField
{
/* Methods */
void addChars
( string
$chars
)
void addString
( string
$string
)
void align
( int
$alignement
)
__construct
([ int
$flags
] )
void setBounds
( float
$width
, float $height
)
void setColor
( int
$red
, int $green
, int $blue
[, int $a = 255
] )
void setFont
( SWFFont
$font
)
void setHeight
( float
$height
)
void setIndentation
( float
$width
)
void setLeftMargin
( float
$width
)
void setLineSpacing
( float
$height
)
void setMargins
( float
$left
, float $right
)
void setName
( string
$name
)
void setPadding
( float
$padding
)
void setRightMargin
( float
}$width
)The SWFVideoStream classIntroductionSWFVideoStream. Class synopsisSWFVideoStream
class SWFVideoStream
{
/* Methods */
__construct
([ string
$file
] )
int getNumFrames
( void
)
void setDimension
( int
}$x
, int $y
) |