SWFMorph->getshape2
<<<
SWFMorph SWFMovie->add
>>>

6.21 Ming pour Flash
6 Référence des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Configuration à l'exécution
Types de ressources
Constantes pré-définies
Classes pré-définies
ming_keypress
ming_setcubicthreshold
ming_setscale
ming_useConstants
ming_useswfversion
SWFAction
SWFBitmap->getHeight
SWFBitmap->getWidth
SWFBitmap
SWFbutton->addAction
SWFButton::addASound
SWFbutton->addShape
SWFbutton->setAction
SWFbutton->setdown
SWFbutton->setHit
SWFButton::setMenu
SWFbutton->setOver
SWFbutton->setUp
SWFbutton
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->moveTo
SWFFill->rotateTo
SWFFill->scaleTo
SWFFill->skewXTo
SWFFill->skewYTo
SWFFill
SWFFont::getAscent
SWFFont::getDescent
SWFFont::getLeading
SWFFont::getShape
SWFFont::getUTF8Width
swffont->getwidth
SWFFont
SWFFontChar::addChars
SWFFontChar::addUTF8Chars
SWFGradient->addEntry
SWFGradient
SWFMorph->getshape1
SWFMorph->getshape2
->SWFMorph
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
SWFMovie
SWFPrebuiltClip
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
SWFShape
SWFSound
SWFSoundInstance::loopCount
SWFSoundInstance::loopInPoint
SWFSoundInstance::loopOutPoint
SWFSoundInstance::noMultiple
swfsprite->add
SWFSprite::labelFrame
SWFSprite->nextframe
SWFSprite->remove
SWFSprite->setframes
SWFSprite::startSound
SWFSprite::stopSound
SWFSprite
SWFText->addString
SWFText::addUTF8String
SWFText::getAscent
SWFText::getDescent
SWFText::getLeading
SWFText::getUTF8Width
SWFText->getWidth
SWFText->moveTo
SWFText->setColor
SWFText->setFont
SWFText->setHeight
SWFText->setSpacing
SWFText
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
SWFTextField
SWFVideoStream::getNumFrames
SWFVideoStream::setDimension
SWFVideoStream

6.21.73 SWFMorph()Crée un morphing

[ Exemples avec swfmorph ]   PHP 4 >= 4.0.5

SWFMorph  swfmorph ( void )
Attention

Cette fonction est EXPERIMENTALE . Cela signifie que le comportement de cette fonction, son nom et concrètement, TOUT ce qui est documenté ici peut changer dans un futur proche, SANS PREAVIS! Soyez-en conscient, et utilisez cette fonction à vos risques et périls.

SWFMorph crée un morphing.

swfmorph s'appelle aussi "shape tween". C'est cet objet qui permet toutes ces superbes animations qui mettent à genou votre ordinateur. Joie !

Les méthodes ici sont plutôt bizarres. Il serait tellement plus logique d'avoir seulement new SWFMorph(shape1, shape2); , mais, telles que sont les choses aujourd'hui, la deuxième forme a besoin de savoir qu'elle est l'aboutissement d'un morphing. (cel est dû au fait que Flash commence à dessiner aussitôt qu'il a les commandes de dessin. S'il conservait les descriptions de ses propres formes, et attendait leur totalité avant d'écrire, ceci et bien d'autres choses seraientt tellement plus simples).

SWFMorph a les méthodes suivantes : swfmorph->getshape1 et swfmorph->getshape2 .

Cet exemple simple effectue le morphing d'une gros carré rouge en un carré plus petit, bleu et bordé de noir.
Exemple avec swfmorph

<?php
$p
= new SWFMorph();
$s = $p->getShape1();
$s->setLine(0,0,0,0);
/* Notez que cela se fait dans l'ordre inverse de l'ordre habituel
    (gauche au lieu de droite), mais je n'ai aucune idée de pourquoi... */
$s->setLeftFill($s->addFill(0xff, 0, 0));
$s->movePenTo(-1000,-1000);
$s->drawLine(2000,0);
$s->drawLine(0,2000);
$s->drawLine(-2000,0);
$s->drawLine(0,-2000);
$s = $p->getShape2();
$s->setLine(60,0,0,0);
$s->setLeftFill($s->addFill(0, 0, 0xff));
$s->movePenTo(0,-1000);
$s->drawLine(1000,1000);
$s->drawLine(-1000,1000);
$s->drawLine(-1000,-1000);
$s->drawLine(1000,-1000);
$m = new SWFMovie();
$m->setDimension(3000,2000);
$m->setBackground(0xff, 0xff, 0xff);
$i = $m->add($p);
$i->moveTo(1500,1000);
for(
$r=0.0; $r<=1.0; $r+=0.1)
{
  
$i->setRatio($r);
  
$m->nextFrame();
}
header('Content-type: application/x-shockwave-flash');
$m->output();
?>

<< SWFMorph >>
SWFMorph->getshape2 Ming pour Flash SWFMovie->add