Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Ming functions for Flash : SWFShape->addFill()

SWFShape->addFill()

Adds a solid fill to the shape ()

Example 1347. SWFShape->addFill() example

<?php

$p
= new SWFMorph();

$b = new SWFBitmap(file_get_contents("alphafill.jpg"));
// use your own bitmap
$width = $b->getWidth();
$height = $b->getHeight();

$s = $p->getShape1();
$f = $s->addFill($b, SWFFILL_TILED_BITMAP);
$f->moveTo(-$width/2, -$height/4);
$f->scaleTo(1.0, 0.5);
$s->setLeftFill($f);
$s->movePenTo(-$width/2, -$height/4);
$s->drawLine($width, 0);
$s->drawLine(0, $height/2);
$s->drawLine(-$width, 0);
$s->drawLine(0, -$height/2);

$s = $p->getShape2();
$f = $s->addFill($b, SWFFILL_TILED_BITMAP);

// these two have no effect!
$f->moveTo(-$width/4, -$height/2);
$f->scaleTo(0.5, 1.0);

$s->setLeftFill($f);
$s->movePenTo(-$width/4, -$height/2);
$s->drawLine($width/2, 0);
$s->drawLine(0, $height);
$s->drawLine(-$width/2, 0);
$s->drawLine(0, -$height);

$m = new SWFMovie();
$m->setDimension($width, $height);
$i = $m->add($p);
$i->moveTo($width/2, $height/2);

for (
$n=0; $n<1.001; $n+=0.03) {
   
$i->setRatio($n);
   
$m->nextFrame();
}

header('Content-type: application/x-shockwave-flash');
$m->output();
?>

Related Examples ( Source code ) » swfshape.addfill




Change Language


Follow Navioo On Twitter
SWFAction
SWFAction->__construct()
SWFBitmap
SWFBitmap->__construct()
SWFBitmap->getHeight()
SWFBitmap->getWidth()
SWFButton
SWFButton->__construct()
SWFButton->addAction()
SWFButton->addASound()
SWFButton->addShape()
SWFButton->setAction()
SWFButton->setDown()
SWFButton->setHit()
SWFButton->setMenu()
SWFButton->setOver()
SWFButton->setUp()
SWFDisplayItem
SWFDisplayItem->addAction()
SWFDisplayItem->addColor()
SWFDisplayItem->endMask()
SWFDisplayItem->getRot()
SWFDisplayItem->getX()
SWFDisplayItem->getXScale()
SWFDisplayItem->getXSkew()
SWFDisplayItem->getY()
SWFDisplayItem->getYScale()
SWFDisplayItem->getYSkew()
SWFDisplayItem->move()
SWFDisplayItem->moveTo()
SWFDisplayItem->multColor()
SWFDisplayItem->remove()
SWFDisplayItem->rotate()
SWFDisplayItem->rotateTo()
SWFDisplayItem->scale()
SWFDisplayItem->scaleTo()
SWFDisplayItem->setDepth()
SWFDisplayItem->setMaskLevel()
SWFDisplayItem->setMatrix()
SWFDisplayItem->setName()
SWFDisplayItem->setRatio()
SWFDisplayItem->skewX()
SWFDisplayItem->skewXTo()
SWFDisplayItem->skewY()
SWFDisplayItem->skewYTo()
SWFFill
SWFFill->moveTo()
SWFFill->rotateTo()
SWFFill->scaleTo()
SWFFill->skewXTo()
SWFFill->skewYTo()
SWFFont
SWFFont->__construct()
SWFFont->getAscent()
SWFFont->getDescent()
SWFFont->getLeading()
SWFFont->getShape()
SWFFont->getUTF8Width()
SWFFont->getWidth()
SWFFontChar
SWFFontChar->addChars()
SWFFontChar->addUTF8Chars()
SWFGradient
SWFGradient->__construct()
SWFGradient->addEntry()
SWFMorph
SWFMorph->__construct()
SWFMorph->getShape1()
SWFMorph->getShape2()
SWFMovie
SWFMovie->__construct()
SWFMovie->add()
SWFMovie->addExport()
SWFMovie->addFont()
SWFMovie->importChar()
SWFMovie->importFont()
SWFMovie->labelFrame()
SWFMovie->nextFrame()
SWFMovie->output()
SWFMovie->remove()
SWFMovie->save()
SWFMovie->saveToFile()
SWFMovie->setbackground()
SWFMovie->setDimension()
SWFMovie->setFrames()
SWFMovie->setRate()
SWFMovie->startSound()
SWFMovie->stopSound()
SWFMovie->streamMP3()
SWFMovie->writeExports()
SWFPrebuiltClip
SWFPrebuiltClip->__construct()
SWFShape
SWFShape->__construct()
SWFShape->addFill()
SWFShape->drawArc()
SWFShape->drawCircle()
SWFShape->drawCubic()
SWFShape->drawCubicTo()
SWFShape->drawCurve()
SWFShape->drawCurveTo()
SWFShape->drawGlyph()
SWFShape->drawLine()
SWFShape->drawLineTo()
SWFShape->movePen()
SWFShape->movePenTo()
SWFShape->setLeftFill()
SWFShape->setLine()
SWFShape->setRightFill()
SWFSound
SWFSound
SWFSoundInstance
SWFSoundInstance->loopCount()
SWFSoundInstance->loopInPoint()
SWFSoundInstance->loopOutPoint()
SWFSoundInstance->noMultiple()
SWFSprite
SWFSprite->__construct()
SWFSprite->add()
SWFSprite->labelFrame()
SWFSprite->nextFrame()
SWFSprite->remove()
SWFSprite->setFrames()
SWFSprite->startSound()
SWFSprite->stopSound()
SWFText
SWFText->__construct()
SWFText->addString()
SWFText->addUTF8String()
SWFText->getAscent()
SWFText->getDescent()
SWFText->getLeading()
SWFText->getUTF8Width()
SWFText->getWidth()
SWFText->moveTo()
SWFText->setColor()
SWFText->setFont()
SWFText->setHeight()
SWFText->setSpacing()
SWFTextField
SWFTextField->__construct()
SWFTextField->addChars()
SWFTextField->addString()
SWFTextField->align()
SWFTextField->setBounds()
SWFTextField->setColor()
SWFTextField->setFont()
SWFTextField->setHeight()
SWFTextField->setIndentation()
SWFTextField->setLeftMargin()
SWFTextField->setLineSpacing()
SWFTextField->setMargins()
SWFTextField->setName()
SWFTextField->setPadding()
SWFTextField->setRightMargin()
SWFVideoStream
SWFVideoStream->__construct()
SWFVideoStream->getNumFrames()
SWFVideoStream->setDimension()
ming_keypress
ming_setcubicthreshold
ming_setscale
ming_setswfcompression
ming_useconstants
ming_useswfversion
eXTReMe Tracker