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.34 SWFShape->addFill

[ Exemples avec SWFShape->addFill ]  

Description

void swfshape->addfill(int red ,int green ,int blue ,[int a ])

void swfshape->addfill(SWFbitmap bitmap ,[int flags ])

void swfshape->addfill(SWFGradient gradient ,[int flags ])

swfshape->addfill ajoute un remplissage plein à la forme. swfshape->addfill accepte trois différents types d'arguments.

red, green, blue est une couleur (format RGB). Le dernier paramètre a est optionnel.

L'argument bitmap est un objet swfbitmap. Le paramètre flags peut être l'un des suivants : SWFFILL_CLIPPED_BITMAP ou SWFFILL_TILED_BITMAP. Par défault, c'est SWFFILL_TILED_BITMAP. Je crois.

L'argument gradient est un objet swfgradient. L'argument flags peut alors prendre l'une des valeurs suivantes : SWFFILL_RADIAL_GRADIENT ou SWFFILL_LINEAR_GRADIENT. Par défaut, c'est SWFFILL_LINEAR_GRADIENT. Cette fois ci, j'en suis sûr.

swfshape->addfill retourne un objet swffill à utiliser avec swfshape->setleftfill, et swfshape->setrightfill décrite un peu plus loin.

Voir aussi swfshape->setleftfill et swfshape->setrightfill.

Ceci est un exemple simple qui affiche un cadre sur une bitmap. Ah, il y a un petit bug dans le lecteur Flash : il ne semble pas faire grand cas de la transformation de la seconde forme en morphing. Suivant les specs, la bitmap devrait s'étirer avec la forme dans cet exemple...
Exemple avec swfshape->addfill

<?php
  $p 
= new SWFMorph();
  
$b = new SWFBitmap("alphafill.jpg");
  
// utilisez vos propres bitmaps!
  
$width $b->getWidth();
  
$height $b->getHeight();
  
$s $p->getShape1();
  
$f $s->addFill($bSWFFILL_TILED_BITMAP);
  
$f->moveTo(-$width/2, -$height/4);
  
$f->scaleTo(1.00.5);
  
$s->setLeftFill($f);
  
$s->movePenTo(-$width/2, -$height/4);
  
$s->drawLine($width0);
  
$s->drawLine(0$height/2);
  
$s->drawLine(-$width0);
  
$s->drawLine(0, -$height/2);
  
$s $p->getShape2();
  
$f $s->addFill($bSWFFILL_TILED_BITMAP);
  
// ces déplacements n'ont aucun effet
  
$f->moveTo(-$width/4, -$height/2);
  
$f->scaleTo(0.51.0);
  
$s->setLeftFill($f);
  
$s->movePenTo(-$width/4, -$height/2);
  
$s->drawLine($width/20);
  
$s->drawLine(0$height);
  
$s->drawLine(-$width/20);
  
$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();
?>


Chapitre précédentChapitre suivantAccueil nexen.net