SWFDisplayItem->setName
<<<
SWFDisplayItem->setRatio SWFDisplayItem->skewX
>>>

6.59 Ming pour Flash
6 Index des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Configuration à l'exécution
Types de ressources
Constantes Prédefinies
Classes Prédefinies
ming_setcubicthreshold
ming_setscale
ming_useswfversion
SWFAction
SWFBitmap->getHeight
SWFBitmap->getWidth
SWFBitmap
swfbutton_keypress
SWFbutton->addAction
SWFbutton->addShape
SWFbutton->setAction
SWFbutton->setDown
SWFbutton->setHit
SWFbutton->setOver
SWFbutton->setUp
SWFbutton
SWFDisplayItem->addColor
SWFDisplayItem->move
SWFDisplayItem->moveTo
SWFDisplayItem->multColor
SWFDisplayItem->remove
SWFDisplayItem->Rotate
SWFDisplayItem->rotateTo
SWFDisplayItem->scale
SWFDisplayItem->scaleTo
SWFDisplayItem->setDepth
SWFDisplayItem->setName
->SWFDisplayItem->setRatio
SWFDisplayItem->skewX
SWFDisplayItem->skewXTo
SWFDisplayItem->skewY
SWFDisplayItem->skewYTo
SWFDisplayItem
SWFFill->moveTo
SWFFill->rotateTo
SWFFill->scaleTo
SWFFill->skewXTo
SWFFill->skewYTo
SWFFill
swffont->getwidth
SWFFont
SWFGradient->addEntry
SWFGradient
SWFMorph->getshape1
SWFMorph->getshape2
SWFMorph
SWFMovie->add
SWFMovie->nextframe
SWFMovie->output
SWFMovie->remove
SWFMovie->save
SWFMovie->setbackground
SWFMovie->setdimension
SWFMovie->setframes
SWFMovie->setrate
SWFMovie->streammp3
SWFMovie
SWFShape->addFill
SWFShape->drawCurve
SWFShape->drawCurveTo
SWFShape->drawLine
SWFShape->drawLineTo
SWFShape->movePen
SWFShape->movePenTo
SWFShape->setLeftFill
SWFShape->setLine
SWFShape->setRightFill
SWFShape
SWFSprite->add
SWFSprite->nextframe
SWFSprite->remove
SWFSprite->setframes
SWFSprite
SWFText->addString
SWFText->getWidth
SWFText->moveTo
SWFText->setColor
SWFText->setFont
SWFText->setHeight
SWFText->setSpacing
SWFText
SWFTextField->addstring
SWFTextField->align
SWFTextField->setbounds
SWFTextField->setcolor
SWFTextField->setFont
SWFTextField->setHeight
SWFTextField->setindentation
SWFTextField->setLeftMargin
SWFTextField->setLineSpacing
SWFTextField->setMargins
SWFTextField->setname
SWFTextField->setrightMargin
SWFTextField

6.59.35 SWFDisplayItem->setRatio()Modifie le ratio de l'objet

[ Exemples avec swfdisplayitem.setratio ]   CVS uniquement

void  swfdisplayitem->setratio ( double   ratio )
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.

swfdisplayitem->setratio modifie le ratio de l'objet, et le fixe à ratio . Uniquement utile pour les morphings.

L'objet peut être swfshape , swfbutton , swftext ou swfsprite . Il doit avoir été ajouté à une animation avec la fonction swfmovie->add .

Cet exemple simple effectue un morphing délicat de trois cercles concentriques.
Exemple swfdisplayitem->setname

<?php
  $p
= new SWFMorph();
  
$g = new SWFGradient();
  
$g->addEntry(0.0, 0, 0, 0);
  
$g->addEntry(0.16, 0xff, 0xff, 0xff);
  
$g->addEntry(0.32, 0, 0, 0);
  
$g->addEntry(0.48, 0xff, 0xff, 0xff);
  
$g->addEntry(0.64, 0, 0, 0);
  
$g->addEntry(0.80, 0xff, 0xff, 0xff);
  
$g->addEntry(1.00, 0, 0, 0);
  
$s = $p->getShape1();
  
$f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT);
  
$f->scaleTo(0.05);
  
$s->setLeftFill($f);
  
$s->movePenTo(-160, -120);
  
$s->drawLine(320, 0);
  
$s->drawLine(0, 240);
  
$s->drawLine(-320, 0);
  
$s->drawLine(0, -240);
  
$g = new SWFGradient();
  
$g->addEntry(0.0, 0, 0, 0);
  
$g->addEntry(0.16, 0xff, 0, 0);
  
$g->addEntry(0.32, 0, 0, 0);
  
$g->addEntry(0.48, 0, 0xff, 0);
  
$g->addEntry(0.64, 0, 0, 0);
  
$g->addEntry(0.80, 0, 0, 0xff);
  
$g->addEntry(1.00, 0, 0, 0);
  
$s = $p->getShape2();
  
$f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT);
  
$f->scaleTo(0.05);
  
$f->skewXTo(1.0);
  
$s->setLeftFill($f);
  
$s->movePenTo(-160, -120);
  
$s->drawLine(320, 0);
  
$s->drawLine(0, 240);
  
$s->drawLine(-320, 0);
  
$s->drawLine(0, -240);
  
$m = new SWFMovie();
  
$m->setDimension(320, 240);
  
$i = $m->add($p);
  
$i->moveTo(160, 120);
  for(
$n=0; $n<=1.001; $n+=0.01)
  {
    
$i->setRatio($n);
    
$m->nextFrame();
  }
  
header('Content-type: application/x-shockwave-flash');
  
$m->output();
?>

<< SWFDisplayItem->setRatio >>
SWFDisplayItem->setName Ming pour Flash SWFDisplayItem->skewX