Ming (flash)Inhaltsverzeichnis
The SWFAction classEinführungSWFAction. KlassenbeschreibungSWFAction
class SWFAction
{
/* Methoden */
__construct
( string
}$script
)BeschreibungThe 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 classEinführungSWFBitmap. KlassenbeschreibungSWFBitmap
class SWFBitmap
{
/* Methoden */
__construct
( mixed
$file
[, mixed $alphafile
] )
float getHeight
( void
)
float getWidth
( void
)
}The SWFButton classEinführungSWFButton. KlassenbeschreibungSWFButton
class SWFButton
{
/* Methoden */
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 classEinführungSWFDisplayItem. KlassenbeschreibungSWFDisplayItem
class SWFDisplayItem
{
/* Methoden */
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 classEinführungThe SWFFill object allows you to transform (scale, skew, rotate) bitmap and gradient fills. swffill objects are created by the SWFShape::addFill method. KlassenbeschreibungSWFFill
class SWFFill
{
/* Methoden */
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 classEinführungThe SWFFont object represent a reference to the font definition, for us with SWFText::setFont and SWFTextField::setFont. KlassenbeschreibungSWFFont
class SWFFont
{
/* Methoden */
__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 classEinführungSWFFontChar. KlassenbeschreibungSWFFontChar
class SWFFontChar
{
/* Methoden */
void addChars
( string
$char
)
void addUTF8Chars
( string
}$char
)The SWFGradient classEinführungSWFGradient. KlassenbeschreibungSWFGradient
class SWFGradient
{
/* Methoden */
void addEntry
( float
$ratio
, int $red
, int $green
, int $blue
[, int $alpha = 255
] )
__construct
( void
)
}The SWFMorph classEinführungThe 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.) KlassenbeschreibungSWFMorph
class SWFMorph
{
/* Methoden */
__construct
( void
)
SWFShape getShape1
( void
)
SWFShape getShape2
( void
)
}The SWFMovie classEinführungSWFMovie is a movie object representing an SWF movie. KlassenbeschreibungSWFMovie
class SWFMovie
{
/* Methoden */
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 classEinführungSWFPrebuiltClip. KlassenbeschreibungSWFPrebuiltClip
class SWFPrebuiltClip
{
/* Methoden */
__construct
( mixed
}$file
)The SWFShape classEinführungSWFShape. KlassenbeschreibungSWFShape
class SWFShape
{
/* Methoden */
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 classEinführungSWFSound. KlassenbeschreibungSWFSound
class SWFSound
{
/* Methoden */
__construct
( string
}$filename
[, int $flags = 0
] )The SWFSoundInstance classEinführungSWFSoundInstance objects are returned by the SWFSprite::startSound and SWFMovie::startSound methods. KlassenbeschreibungSWFSoundInstance
class SWFSoundInstance
{
/* Methoden */
void loopCount
( int
$point
)
void loopInPoint
( int
$point
)
void loopOutPoint
( int
$point
)
void noMultiple
( void
)
}The SWFSprite classEinführungAn 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. KlassenbeschreibungSWFSprite
class SWFSprite
{
/* Methoden */
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 classEinführungSWFText. KlassenbeschreibungSWFText
class SWFText
{
/* Methoden */
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 classEinführungSWFTextField. KlassenbeschreibungSWFTextField
class SWFTextField
{
/* Methoden */
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 classEinführungSWFVideoStream. KlassenbeschreibungSWFVideoStream
class SWFVideoStream
{
/* Methoden */
__construct
([ string
$file
] )
int getNumFrames
( void
)
void setDimension
( int
}$x
, int $y
) |