SWFText

(PHP 4 >= 4.0.5)

SWFText -- Creates a new SWFText object

Description

SWFText swftext ( void )

Внимание

Эта функция является ЭКСПЕРИМЕНТАЛЬНОЙ. Поведение этой функции, ее имя и относящаяся к ней документация могут измениться в последующих версиях PHP без уведомления. Используйте эту функцию на свой страх и риск.

swftext() creates a new SWFText object, fresh for manipulating.

SWFText has the following methods : swftext->setfont(), swftext->setheight(), swftext->setspacing(), swftext->setcolor(), swftext->moveto(), swftext->addstring() and swftext->getwidth().

This simple example will draw a big yellow "PHP generates Flash with Ming" text, on white background.

Пример 1. swftext() example

<?php
  $f
= new SWFFont("Techno.fdb");
 
$t = new SWFText();
 
$t->setFont($f);
 
$t->moveTo(200, 2400);
 
$t->setColor(0xff, 0xff, 0);
 
$t->setHeight(1200);
 
$t->addString("PHP generates Flash with Ming!!");

 
$m = new SWFMovie();
 
$m->setDimension(5400, 3600);

 
$m->add($t);

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



SWFText
p_smiecho at interia dot pl
01-Dec-2003 03:26
It seems to me that there is a bug: everything works perfect but only with Linux. SWFText crashes while working on Windows. So I do it that way:

   $f = new SWFFont('Arial');
   $t = new SWFTextField();
   $t -> setFont($f);
   $t -> addString('Hello world!!!');

   $p = new SWFSprite();
   $i = $p -> add($t);
   $i -> moveto(100, 100);    // Here you can move text !!
   //$p -> remove($i);

   $m = new SWFMovie();
   ...
   $m -> add($p);

Of course it writes text where I want, but I still can't get other methods of SWFText class. For example: I can't get text width (swftext->getwidth).
franky at boucheros dot com
22-Apr-2002 06:12
For windows platform :

$f=new SWFFont("_sans");
$t=new SWFTextField();

and comment the moveto line.

<SWFText->setSpacingSWFTextField->addstring>
 Last updated: Tue, 15 Nov 2005