Import HTML from PHP or text file

 

The purpose is to import html into swf from a text file pr a php script.
This example is quite simple and has a script.

The different stages gonna be described right now.

Creating Objects

1 - Set up movie size 400x200 (white background). Any frame rate 'll fit.

2 - Create a dynamic text :
Watch out images very carefully :

   

   

Script

In Outline, select Scene_1. Enter the following script :

onLoad()
{ // for PHP write htmltags.php instead
   loadVariables("htmltags.txt");
}
onFrame (1,afterPlacedObjectEvents)
{ // fini 'll be defined in called file
    if (fini==1) gotoSceneAndPlay("<current scene>",4);
}
onFrame (3,afterPlacedObjectEvents)
{
   gotoSceneAndPlay("<current scene>",1);
}
onFrame (4,afterPlacedObjectEvents) { stop(); }

Text file

For instance, write this text :

datalist=<pre><font face='verdana' size='10px' color='#FF0000'><b>Bush</b></font>
<font color='#0000FF'> George Walker</font> Sucks White House 12345 WASHINGTON DC
<font color='#0000FF'><b><u>Cheerack</u></b> Jack Alcatraz-reopened San Francisco CA</pre>&fini=1

Save it as htmltags.txt. Put it in same directory as SWF.

OR

PHP file

For instance, write this text. Save it as htmltags.php.Put it in same directory as SWF.

<?
$datalist="<html><body><pre><font face='verdana' size='10px' color='#FF0000'><b>Bush</b></font><font color='#0000FF'> George Walker</font> Sucks White House 12345 WASHINGTON DC
<font color='#0000FF'><b><u>Cheerack</u></b> Jack Alcatraz-reopened San Francisco CA</pre></body></html>";
echo "datalist=".$datalist."&fini=1";

?>

 


Page chargée en 0.001 sec.

Dernière Modification : Sam 14 Octobre 2023 9:48
Copyright © 1999-2024 Jean-Paul Molina Tous droits réservés.

 

to Google