PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

導入> <HaruDestination::setXYZ
Last updated: Fri, 29 Aug 2008

view this page in

Ming (flash)

phpdoc:classref

SWFAction クラス

導入

SWFAction.

クラス概要

SWFAction
class SWFAction {
/* メソッド */
SWFAction __construct ( string $script )
}

説明

スクリプトの文法は C 言語をもとにしていますが、多くの機能が 省略されています - SWF バイトコードマシンは、より単純であることを 志向しています。例えば、相当手の込んだ細工をしなければ、関数のコールを 実装することもできません。なぜなら、バイトコードの jump 命令は ハードコードされたオフセット値を使用しているからです。 呼び出し元のアドレスをスタックに格納したりはしません - すべての関数は、戻ってくる場所を正確に知っている必要があるのです。

結局、どんな機能が残っているのでしょう? コンパイラが理解できるトークンは 以下のとおりです。

  • break
  • for
  • continue
  • if
  • else
  • do
  • while

データ型は存在しません。SWF アクションマシンにおいては、すべての値は 文字列として扱われます。以下の関数が使用可能です。

time()
ムービーが開始してからの経過時間を、ミリ秒 (?) で返します。
random(seed)
0 から seed までの範囲の擬似乱数を返します。
length(expr)
指定した式の長さを返します。
int(number)
指定した数値を、一番近い整数に切り下げた値を返します。
concat(expr, expr)
指定した式を連結して返します。
ord(expr)
指定した文字の ASCII コードを返します。
chr(num)
指定した ASCII コードに対応する文字を返します。
substr(string, location, length)
指定した文字列 string の、 位置 location から始まる 長さ length の部分文字列を返します。

さらに、以下のコマンドも使用できるでしょう。

duplicateClip(clip, name, depth)
指定したムービークリップ (またの名をスプライト) clip を複製します。 新しいムービークリップの名前は name で、 深度は depth となります。
removeClip(expr)
指定したムービークリップを削除します。
trace(expr)
指定した式をトレースログに書き込みます。ブラウザのプラグインが これをきちんと扱ってくれるかは疑わしいものです。
startDrag(target, lock, [left, top, right, bottom])
ムービークリップ target のドラッグを開始します。 引数 lock で、マウスをロックするかどうか (?) を指定します - 0 (FALSE) あるいは 1 (TRUE) を指定します。 オプションのパラメータでは、ドラッグする範囲のを指定します。
stopDrag()
つかれきった心を落ち着かせます。そしてムービークリップの ドラッグも修了させます。
callFrame(expr)
指定したフレームを関数としてコールします。
getURL(url, target, [method])
指定した URL を読み込みます。引数 target は、 (たとえば "_top" や "_blank" のような) HTML ドキュメントの target に対応します。オプションの引数 method は、 サーバに変数を返したい場合に POST あるいは GET を指定します。
loadMovie(url, target)
指定した URL を読み込みます。引数 target は、 (おそらく) フレームの名前か あるいは特別な値 "_level0" (現在のムービーを置き換える) 、 "_level1" (現在のムービーの前面に新しいムービーを表示する) のうちのいずれかです。
nextFrame()
次のフレームに移動します。
prevFrame()
直前の (あるいは一つ前の) フレームに移動します。
play()
ムービーの再生を開始します。
stop()
ムービーの再生を停止します。
toggleQuality()
高品質/低品質を切り替えます。
stopSounds()
音声の再生を停止します。
gotoFrame(num)
フレーム番号 num に移動します。 フレーム番号は 0 からはじまります。
gotoFrame(name)
name という名前のフレームに移動します。 これは便利です。というのもまだフレームのラベルを追加していないからです。
setTarget(expr)
アクションのコンテキストといわれるものを設定します。 これが何をするものなのかは実際のところよくわかりません。
そしてもうひとつ変なものがあります。if 文や while ループの中で、 指定したフレーム番号が読み込まれているかどうかを調べるために、 式 frameLoaded(num) が使用可能です。ええ。そのようにいわれています。 しかし私は実際にこれをテストしたことがなく、実際に動作するのか 疑問に思っています。かわりに /:framesLoaded を使用するとよいでしょう。

ムービークリップ (さぁみなさんご一緒に - またの名をスプライト) はプロパティをひじしています。すべてのプロパティが読み込み可能で、 そのうちのいくつかには値を設定することも可能です。プロパティの 一覧は以下のとおりです。

  • x
  • y
  • xScale
  • yScale
  • currentFrame - (読み込み専用)
  • totalFrames - (読み込み専用)
  • alpha - 透明度
  • visible - 1=on, 0=off (?)
  • width - (読み込み専用)
  • height - (読み込み専用)
  • rotation
  • target - (読み込み専用) (???)
  • framesLoaded - (読み込み専用)
  • name
  • dropTarget - (読み込み専用) (???)
  • url - (読み込み専用) (???)
  • highQuality - 1=high, 0=low (?)
  • focusRect - (???)
  • soundBufTime - (???)
ということで、スプライトの x 位置を指定するには単に /box.x = 100; とすればよいわけです。なぜ box の前のスラッシュがあるのでしょう? これは、flash がムービー内のスプライトを Unix ファイルシステム風に 管理しているからです - つまり、この場合 box がトップレベルに存在する ことになります。box という名前のスプライトがその中に biff という名前の スプライトを保持している場合、その x 位置を指定するには /box/biff.x = 100; とします。すくなくとも私はそう思っています。 もし間違っていたら指摘してください。

/phpdoc:classref phpdoc:classref

SWFBitmap クラス

導入

SWFBitmap.

クラス概要

SWFBitmap
class SWFBitmap {
/* メソッド */
SWFBitmap __construct ( mixed $file [, mixed $alphafile ] )
float getHeight ( void )
float getWidth ( void )
}
/phpdoc:classref phpdoc:classref

SWFButton クラス

導入

SWFButton.

クラス概要

SWFButton
class SWFButton {
/* メソッド */
void addAction ( SWFAction $action , int $flags )
SWFSoundInstance addASound ( SWFSound $sound , int $flags )
void addShape ( SWFShape $shape , int $flags )
SWFButton __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 )
}
/phpdoc:classref phpdoc:classref

SWFDisplayItem クラス

導入

SWFDisplayItem.

クラス概要

SWFDisplayItem
class SWFDisplayItem {
/* メソッド */
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 ( int $dx , int $dy )
void moveTo ( int $x , int $y )
void multColor ( int $red , int $green , int $blue [, int $a ] )
void remove ( void )
void rotate ( float $angle )
void rotateTo ( float $angle )
void scale ( int $dx , int $dy )
void scaleTo ( int $x [, int $y ] )
void setDepth ( float $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 )
}
/phpdoc:classref phpdoc:classref

SWFFill クラス

導入

SWFFill オブジェクトは、ビットマップや 階調の塗りつぶしを変形 (拡大縮小する・傾ける・回転させる) します。

swffill オブジェクトは SWFShape->addFill メソッドで作成します。

クラス概要

SWFFill
class SWFFill {
/* メソッド */
void moveTo ( int $x , int $y )
void rotateTo ( float $angle )
void scaleTo ( int $x [, int $y ] )
void skewXTo ( float $x )
void skewYTo ( float $y )
}
/phpdoc:classref phpdoc:classref

SWFFont クラス

導入

SWFFont オブジェクトは、フォント定義への参照を表します。 これは SWFText->setFont および SWFTextField->setFont で使用します。

クラス概要

SWFFont
class SWFFont {
/* メソッド */
SWFFont __construct ( string $filename )
float getAscent ( void )
float getDescent ( void )
float getLeading ( void )
string getShape ( int $code )
float getUTF8Width ( string $string )
float getWidth ( string $string )
}
/phpdoc:classref phpdoc:classref

SWFFontChar クラス

導入

SWFFontChar.

クラス概要

SWFFontChar
class SWFFontChar {
/* メソッド */
void addChars ( string $char )
void addUTF8Chars ( string $char )
}
/phpdoc:classref phpdoc:classref

SWFGradient クラス

導入

SWFGradient.

クラス概要

SWFGradient
class SWFGradient {
/* メソッド */
void addEntry ( float $ratio , int $red , int $green , int $blue [, int $a ] )
SWFGradient __construct ( void )
}
/phpdoc:classref phpdoc:classref

SWFMorph クラス

導入

これらのメソッドは少々変わっています。 単に newSWFMorph(shape1, shape2); とできればわかりやすいのですが、 現在は、shape2 が変形の二番目の部分を知っている必要があります (これは、描画コマンドを受け取った時点ですぐに出力を開始するからです。 そうではなく、すべてが完了してから書き出すようにすれば、かなり楽になるのですが)。

クラス概要

SWFMorph
class SWFMorph {
/* メソッド */
SWFMorph __construct ( void )
SWFShape getShape1 ( void )
SWFShape getShape2 ( void )
}
/phpdoc:classref phpdoc:classref

SWFMovie クラス

導入

SWFMovie は SWF ムービーを表すオブジェクトです。

クラス概要

SWFMovie
class SWFMovie {
/* メソッド */
mixed add ( object $instance )
void addExport ( SWFCharacter $char , string $name )
mixed addFont ( SWFFont $font )
SWFMovie __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 ] )
int saveToFile ( stream $x [, int $compression ] )
void setbackground ( int $red , int $green , int $blue )
void setDimension ( int $width , int $height )
void setFrames ( int $number )
void setRate ( int $rate )
SWFSoundInstance startSound ( SWFSound $sound )
void stopSound ( SWFSound $sound )
int streamMP3 ( mixed $mp3file [, float $skip ] )
void writeExports ( void )
}
/phpdoc:classref phpdoc:classref

SWFPrebuiltClip クラス

導入

SWFPrebuiltClip.

クラス概要

SWFPrebuiltClip
class SWFPrebuiltClip {
/* メソッド */
SWFPrebuiltClip __construct ([ string $file ] )
}
/phpdoc:classref phpdoc:classref

SWFShape クラス

導入

SWFShape.

クラス概要

SWFShape
class SWFShape {
/* メソッド */
SWFFill addFill ( int $red , int $green , int $blue [, int $a ] )
SWFShape __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 ( int $controldx , int $controldy , int $anchordx , int $anchordy [, int $targetdx ], int $targetdy )
int drawCurveTo ( int $controlx , int $controly , int $anchorx , int $anchory [, int $targetx ], int $targety )
void drawGlyph ( SWFFont $font , string $character [, int $size ] )
void drawLine ( int $dx , int $dy )
void drawLineTo ( int $x , int $y )
void movePen ( int $dx , int $dy )
void movePenTo ( int $x , int $y )
void setLeftFill ( SWFGradient $fill )
void setLine ( SWFShape $shape )
void setRightFill ( SWFGradient $fill )
}
/phpdoc:classref phpdoc:classref

SWFSound クラス

導入

SWFSound.

クラス概要

SWFSound
class SWFSound {
/* メソッド */
SWFSound __construct ( string $filename , int $flags )
}
/phpdoc:classref phpdoc:classref

SWFSoundInstance クラス

導入

SWFSoundInstance オブジェクトは SWFSprite->startSound および SWFMovie->startSound メソッドが返します。

クラス概要

SWFSoundInstance
class SWFSoundInstance {
/* メソッド */
void loopCount ( int $point )
void loopInPoint ( int $point )
void loopOutPoint ( int $point )
void noMultiple ( void )
}
/phpdoc:classref phpdoc:classref

SWFSprite クラス

導入

SWFSprite は "ムービークリップ" ともいいます。これにより、作成したオブジェクトを 時間軸にそって動かすことができるようになります。 したがって、スプライトはムービーのメソッドの大半を保持しています。

クラス概要

SWFSprite
class SWFSprite {
/* メソッド */
void add ( object $object )
SWFSprite __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 )
}
/phpdoc:classref phpdoc:classref

SWFText クラス

導入

SWFText.

クラス概要

SWFText
class SWFText {
/* メソッド */
void addString ( string $string )
void addUTF8String ( string $text )
void __construct ( void )
float getAscent ( void )
float getDescent ( void )
float getLeading ( void )
float getUTF8Width ( string $string )
float getWidth ( string $string )
void moveTo ( int $x , int $y )
void setColor ( int $red , int $green , int $blue [, int $a ] )
void setFont ( string $font )
void setHeight ( int $height )
void setSpacing ( float $spacing )
}
/phpdoc:classref phpdoc:classref

SWFTextField クラス

導入

SWFTextField.

クラス概要

SWFTextField
class SWFTextField {
/* メソッド */
void addChars ( string $chars )
void addString ( string $string )
void align ( int $alignement )
SWFTextField __construct ([ int $flags ] )
void setBounds ( int $width , int $height )
void setColor ( int $red , int $green , int $blue [, int $a ] )
void setFont ( string $font )
void setHeight ( int $height )
void setIndentation ( int $width )
void setLeftMargin ( int $width )
void setLineSpacing ( int $height )
void setMargins ( int $left , int $right )
void setName ( string $name )
void setPadding ( float $padding )
void setRightMargin ( int $width )
}
/phpdoc:classref phpdoc:classref

SWFVideoStream クラス

導入

SWFVideoStream.

クラス概要

SWFVideoStream
class SWFVideoStream {
/* メソッド */
SWFVideoStream __construct ([ string $file ] )
int getNumFrames ( void )
void setDimension ( int $x , int $y )
}
/phpdoc:classref

add a note add a note User Contributed Notes
Ming
There are no user contributed notes for this page.

導入> <HaruDestination::setXYZ
Last updated: Fri, 29 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites