Thursday, July 29th 2010, 1:40pm UTC+2
You are not logged in.
Auch mit PHP kann man Flash Dokumente erstellen. Nur Leider gibt es nicht viele Provider die ihre Server auf die Ming oder SWF Extension eingestellt haben
Obwohl die Performance (Übertragungsgeschwindigkeit) nachweislich höher liegt als bei herkömlichen swf Dateien die man mit Flash generiert.
|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
<?php
/*****************************************************************************/
/* letzte Update am : Samstag, 4. Julie 2003 */
/* Scriptname : SWFundPHP.php */
/* Scriptdefinition: Scriptbeispiel wie man mit PHP SWF Datei generieren kann*/
/*****************************************************************************/
/* Script: Webmaster Flash-PHP-MAIL (APACHE 2 - PHP5.0 Flash MX) */
/* Version: 1.1-dev */
/* Datum: 2003 */
/* Autor: Juergen Heinemann */
/* E-Mail: mingmaster@gmx.de */
/* URL: http://www.flash-php-mail.de */
/*****************************************************************************/
/* This program is free software; you can redistribute it and/or modify it */
/* under the terms of the GNU General Public License as published by the */
/* Free Software Foundation; either version 2 of the License, or (at your */
/* option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, but */
/* WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General */
/* Public License for more details. */
/* */
/* The GNU GPL can be found in gpl.txt in this directory */
/*****************************************************************************/
$meinPfad = getcwd();
/*****************************************************************************/
if( in_array("swf", get_loaded_extensions() ) || in_array("ming", get_loaded_extensions() ) ) {
function rechteck() {
$rahmen = new SWFshape();
$breite = "650";
$hoehe = "100";
$linie = "1";
$rahmen -> setLine(1 , 0xff, 0xff, 0xff);
$rahmen -> setRightFill($rahmen -> addFill(0x33, 0x33, 0x66));
$rahmen -> movePenTo(0, 0);
$rahmen -> drawLineTo($breite, 0);
$rahmen -> drawLineTo($breite, $hoehe);
$rahmen -> drawLineTo(0, $hoehe);
$rahmen -> drawLineTo(0, 0);
return $rahmen;
}
function oval() {
$kreis = new SWFShape();
$r = 45; // Radius
$x = 250; // Position X
$y = 100; // Position Y
$a = $r * 0.414213562;
$b = $r * 0.707106781;
$kreis -> setLine(1, 0xff, 0xff, 0xff);
$kreis -> movePenTo($x+$r, $y);
$kreis -> setRightFill($kreis -> addFill(0x66, 0x66, 0x99));
$kreis -> drawCurveTo($x+$r, $y-$a, $x+$b, $y-$b);
$kreis -> drawCurveTo($x+$a, $y-$r, $x, $y-$r);
$kreis -> drawCurveTo($x-$a, $y-$r, $x-$b, $y-$b);
$kreis -> drawCurveTo($x-$r, $y-$a, $x-$r, $y);
$kreis -> drawCurveTo($x-$r, $y+$a, $x-$b, $y+$b);
$kreis -> drawCurveTo($x-$a, $y+$r, $x, $y+$r);
$kreis -> drawCurveTo($x+$a, $y+$r, $x+$b, $y+$b);
$kreis -> drawCurveTo($x+$r, $y+$a, $x+$r, $y);
return $kreis;
}
function schrifft() {
Global $meinPfad;
$font = new SWFFont($meinPfad . "/fonts/serif.fdb");
$schrifft = new SWFShape();
$schrifft -> setLine(1, 0xff, 0xff, 0xff);
$schrifft -> setRightFill($schrifft -> addFill(0x00, 0, 10));
$schrifft -> movePenTo(372, 120);
$schrifft -> drawGlyph($font, "p");
$schrifft -> movePenTo(412, 120);
$schrifft -> drawGlyph($font, "h");
$schrifft -> movePenTo(452, 120);
$schrifft -> drawGlyph($font, "p");
return $schrifft;
}
function textfeld() {
Global $meinPfad;
// Nur wenn Ming extension Vorhanden!
// Ming_setScale(1.0);
$text = "Viel Spass damit Mingmaster";
$font = new SWFFont($meinPfad . "/fonts/astralfont.fdb");
$schrifft = new SWFText();
$schrifft -> setFont($font);
$schrifft -> setColor(0x00, 0x80, 0xc0);
$schrifft -> setHeight(48);
$schrifft -> moveTo(-$schrifft -> getWidth($text)/2, $schrifft -> getAscent()/2);
$schrifft -> addString($text);
return $schrifft;
}
function poweredwidth() {
Global $meinPfad;
// Nur wenn Ming extension Vorhanden!
// Ming_setScale(1.0);
$text = "Dieses Script wurde erstellt mit PHP und benoetigt die Ming oder SWF extension!";
$font = new SWFFont($meinPfad . "/fonts/serif.fdb");
$schrifft = new SWFText();
$schrifft -> setFont($font);
$schrifft -> setColor(0xff, 0xff, 0xff);
$schrifft -> setHeight(12);
$schrifft -> moveTo(-$schrifft -> getWidth($text)/2, $schrifft -> getAscent()/2);
$schrifft -> addString($text);
return $schrifft;
}
function ausfuehren() {
$movie = new SWFMovie();
$movie -> setDimension(800, 600);
$movie -> setBackground(0x33,0x33,0x33);
$movie -> setRate(24.0);
$kreisform = $movie -> add(oval());
$kreisform -> scale(1.6, 1.05);
$textform = $movie -> add(schrifft());
$textform -> skewx(-0.2);
$rechteck = $movie -> add(rechteck());
$rechteck -> moveTo(80, 250);
$textmade = $movie -> add(poweredwidth());
$textmade -> moveTo(400, 180);
$infotext = $movie -> add(textfeld());
$infotext -> moveTo(800/2, 600/2);
for ($j=0; $j<360; $j+=7.5) {
$infotext -> rotateTo(-$j);
$movie -> nextFrame();
}
header("Content-type: application/x-shockwave-flash");
$movie -> output();
return $movie;
}
// Starte Aufruf
if(ini_get('output_buffering') != 0) {
ob_start();
echo ausfuehren();
$zeigen = ob_get_contents();
ob_end_clean();
} else {
$zeigen = ausfuehren();
}
} elseif ($_GET['getinfo'] == "infosuche") {
phpinfo();
} else {
echo "<div align=\"center\"><strong style='ruby-align: center;'>Es scheint keine <font color='#FF0000'>
swf</font> Extension auf deinem System vorhanden zu sein! :-/ <br> Möchtest du danach suchen?
Dann Rufe <a href='" .$_SERVER['PHP_SELF']. "?getinfo=infosuche'>phpinfo</a> auf!
Mehr Info oder Hilfe unter <a href='http://www.flashbattle.de'> Flashbattle.de</a></strong></div>";
}
// Viel Spaß beim Ausprobieren!
echo $zeigen;
// mfg Ming
?>
|

Quoted
Original von Madokan
Klasse umgesetzt!
Liebe Grüsse
Matze K.
P.S.: Der Copyright Vermerk in einem Forum find ich süss.![]()
