Thursday, July 29th 2010, 1:40pm UTC+2

You are not logged in.

  • Login
  • Register

undefined

Super Moderator

Posts: 4,248

Location: Germany

1

Friday, July 4th 2003, 7:33pm

Mit PHP SWF Dateien Generieren

Ja - richtig gelesen :] 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 :rolleyes: Obwohl die Performance (Übertragungsgeschwindigkeit) nachweislich höher liegt als bei herkömlichen swf Dateien die man mit Flash generiert.
Aber um euch ein kleines Beispiel zu zeigen wie man es macht. Seht euch dieses Script einmal an ;)

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(0xff0xff0xff);
   $rahmen -> setRightFill($rahmen -> addFill(0x330x330x66));
   $rahmen -> movePenTo(00);
   $rahmen -> drawLineTo($breite0);
   $rahmen -> drawLineTo($breite$hoehe);
   $rahmen -> drawLineTo(0$hoehe);
   $rahmen -> drawLineTo(00);
   
  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(10xff0xff0xff);
   $kreis -> movePenTo($x+$r$y);
   $kreis -> setRightFill($kreis -> addFill(0x660x660x99));
   $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(10xff0xff0xff);
    $schrifft -> setRightFill($schrifft -> addFill(0x00010));
    $schrifft -> movePenTo(372120);
    $schrifft -> drawGlyph($font"p");
    $schrifft -> movePenTo(412120);
    $schrifft -> drawGlyph($font"h");
    $schrifft -> movePenTo(452120);
    $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(0x000x800xc0);
    $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(0xff0xff0xff);
    $schrifft -> setHeight(12);
    $schrifft -> moveTo(-$schrifft -> getWidth($text)/2$schrifft -> getAscent()/2);
    $schrifft -> addString($text);
   return $schrifft;
 }
 
 function ausfuehren() {
  
  $movie = new SWFMovie();
  
  $movie -> setDimension(800600);
  $movie -> setBackground(0x33,0x33,0x33);
  $movie -> setRate(24.0);
  
    $kreisform $movie -> add(oval());
    $kreisform -> scale(1.61.05);
    
    $textform $movie -> add(schrifft());
    $textform -> skewx(-0.2);
    
    $rechteck $movie -> add(rechteck());
    $rechteck -> moveTo(80250);
    
    $textmade $movie -> add(poweredwidth());
    $textmade -> moveTo(400180);
    
    $infotext $movie -> add(textfeld());
    $infotext -> moveTo(800/2600/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
?>


Links zur Extension Info http://www.the-labs.com/MacromediaFlash/
Vile Spaß Ming
Undefined Behavior (undefiniertes Verhalten) bedeutet meistens etwas ungültiges.
PHP Katepart - Speichenrechner - .htpasswd - RPM XDG Tool - Kcmnvview - QTidy
  • Go to the top of the page

Madokan

Super Moderator

Posts: 1,654

Location: US/Germany

2

Tuesday, July 8th 2003, 12:20pm

Klasse umgesetzt! :)

Liebe Grüsse
Matze K.

P.S.: Der Copyright Vermerk in einem Forum find ich süss. ;)
[Flashstar]
Flashstar Site
[ActionScript - Praxis]
ActionScript Praxis - Buchinfo
[Flash 8 - HotStuff Buch]
Bestellung
[Flash 8 - Professional Series Buch]
Bestellung
[Flash CS3 Powerworkshops]
Bestellung
  • Go to the top of the page

undefined

Super Moderator

Posts: 4,248

Location: Germany

3

Tuesday, July 15th 2003, 6:27pm

Quoted

Original von Madokan
Klasse umgesetzt! :)

Liebe Grüsse
Matze K.

P.S.: Der Copyright Vermerk in einem Forum find ich süss. ;)


Nur schade das ich noch keinen Anbieter mit Ming gefunden habe! Dann würde ich viel mehr damit machen. Mich Interessiert hier Hauptsächlich das dynamische einbinden von SWF Dateien. Damit könnte man richtig gute und universale Templates erstellen.

Das mit dem Copyright ist bei mir die Standard Vorlage Datei. Mit der Zeit Dokumentiert man seine Scripte. Ist aber auch mehr Werbung. Die meisten geben leider nichts darauf. :rolleyes:
Undefined Behavior (undefiniertes Verhalten) bedeutet meistens etwas ungültiges.
PHP Katepart - Speichenrechner - .htpasswd - RPM XDG Tool - Kcmnvview - QTidy
  • Go to the top of the page

Madokan

Super Moderator

Posts: 1,654

Location: US/Germany

4

Monday, July 21st 2003, 10:26am

Yup das ist ein Problem - da brauchst einen dedicierten Server, da könnte man ming drauf spielen. Wobei die das PHP-SWF-Lib Modul ja auch ausreichen würde, aber auch diese bieten Provider nicht an. :(

Liebe Grüsse
Matze K.
[Flashstar]
Flashstar Site
[ActionScript - Praxis]
ActionScript Praxis - Buchinfo
[Flash 8 - HotStuff Buch]
Bestellung
[Flash 8 - Professional Series Buch]
Bestellung
[Flash CS3 Powerworkshops]
Bestellung
  • Go to the top of the page

5

Friday, August 12th 2005, 8:40am

Hallo und guten Tag!

Ich bin erst neu hier aber verfolge nun schon eine Weile eure Beiträge.
Ich kenne einen Provider, der in seinem kleinsten Paket (Visitenkarte)
schon PHP unterstützt und die Ming-Extension ist auch enabled.

Provider: http://www.prosite.de
Schöne Grüße!
Oliver
  • Go to the top of the page