SommaireTelecharger la documentationChapitre suivantChapitre precedent  

  .: News :.: Edito :.: Scripts :.: Forum :.: Erreurs :.: Jobs :. 
 
Sommaire

Ming pour Flash

Introduction
Installation
Comment utiliser Ming
SWFMovie
SWFMovie->output
SWFMovie->save
SWFMovie->add
SWFMovie->remove
SWFMovie->setbackground
SWFMovie->setrate
SWFMovie->setdimension
SWFMovie->setframes
SWFMovie->nextframe
SWFMovie->streammp3
SWFDisplayItem
SWFDisplayItem->moveTo
SWFDisplayItem->move
SWFDisplayItem->scaleTo
SWFDisplayItem->scale
SWFDisplayItem->rotateTo
SWFDisplayItem->Rotate
SWFDisplayItem->skewXTo
SWFDisplayItem->skewX
SWFDisplayItem->skewYTo
SWFDisplayItem->skewY
SWFDisplayItem->setDepth
SWFDisplayItem->remove
SWFDisplayItem->setName
SWFDisplayItem->setRatio
SWFDisplayItem->addColor
SWFDisplayItem->multColor
SWFShape
SWFShape->setLine
SWFShape->addFill
SWFShape->setLeftFill
SWFShape->setRightFill
SWFShape->movePenTo
SWFShape->movePen
SWFShape->drawLineTo
SWFShape->drawLine
SWFShape->drawCurveTo
SWFShape->drawCurve
SWFGradient
SWFGradient->addEntry
SWFBitmap
SWFBitmap->getWidth
SWFBitmap->getHeight
SWFFill
SWFFill->moveTo
SWFFill->scaleTo
SWFFill->rotateTo
SWFFill->skewXTo
SWFFill->skewYTo
SWFMorph
SWFMorph->getshape1
SWFMorph->getshape2
SWFText
SWFText->setFont
SWFText->setHeight
SWFText->setSpacing
SWFText->setColor
SWFText->moveTo
SWFText->addString
SWFText->getWidth
SWFFont
swffont->getwidth
SWFTextField
SWFTextField->setFont
SWFTextField->setbounds
SWFTextField->align
SWFTextField->setHeight
SWFTextField->setLeftMargin
SWFTextField->setrightMargin
SWFTextField->setMargins
SWFTextField->setindentation
SWFTextField->setLineSpacing
SWFTextField->setcolor
SWFTextField->setname
SWFTextField->addstring
SWFSprite
SWFSprite->add
SWFSprite->remove
SWFSprite->setframes
SWFSprite->nextframe
SWFbutton
SWFbutton->addShape
SWFbutton->setUp
SWFbutton->setOver
SWFbutton->setDown
SWFbutton->setHit
SWFbutton->addAction
SWFbutton->setAction
SWFAction

6.57.29 SWFDisplayItem->setRatio

[ Exemples avec SWFDisplayItem->setRatio ]  

Description

void swfdisplayitem->setratio(double ratio )

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.0000);
  
$g->addEntry(0.160xff0xff0xff);
  
$g->addEntry(0.32000);
  
$g->addEntry(0.480xff0xff0xff);
  
$g->addEntry(0.64000);
  
$g->addEntry(0.800xff0xff0xff);
  
$g->addEntry(1.00000);
  
$s $p->getShape1();
  
$f $s->addFill($gSWFFILL_RADIAL_GRADIENT);
  
$f->scaleTo(0.05);
  
$s->setLeftFill($f);
  
$s->movePenTo(-160, -120);
  
$s->drawLine(3200);
  
$s->drawLine(0240);
  
$s->drawLine(-3200);
  
$s->drawLine(0, -240);
  
$g = new SWFGradient();
  
$g->addEntry(0.0000);
  
$g->addEntry(0.160xff00);
  
$g->addEntry(0.32000);
  
$g->addEntry(0.4800xff0);
  
$g->addEntry(0.64000);
  
$g->addEntry(0.80000xff);
  
$g->addEntry(1.00000);
  
$s $p->getShape2();
  
$f $s->addFill($gSWFFILL_RADIAL_GRADIENT);
  
$f->scaleTo(0.05);
  
$f->skewXTo(1.0);
  
$s->setLeftFill($f);
  
$s->movePenTo(-160, -120);
  
$s->drawLine(3200);
  
$s->drawLine(0240);
  
$s->drawLine(-3200);
  
$s->drawLine(0, -240);
  
$m = new SWFMovie();
  
$m->setDimension(320240);
  
$i $m->add($p);
  
$i->moveTo(160120);
  for(
$n=0$n<=1.001$n+=0.01)
  {
    
$i->setRatio($n);
    
$m->nextFrame();
  }
  
header('Content-type: application/x-shockwave-flash');
  
$m->output();
?>


Chapitre précédentChapitre suivantAccueil nexen.net