Embedding an irrepressible.info fragment in flash
The following is a brief introduction to embedding a fragment from the irrepressible.info database within a flash page.
The irrepressible site gives code for embedding the content using banners/ buttons within html using javascript, this is just an indication of how I did it for my flash page.
The method requires the PHP cURL library to be supported on your server.
- Within the flash file, create a movieclip with a dynamic textfield inside it and place it on the stage at root level, giving it the instance name 'irr_mc'; give the textfield inside irr_mc the instance name 'irr_txt'. Place the following Actionscript code also at root level (on the main timeline):
You need Flash Player to view the content here...
- Place the following PHP code in a file named 'get_fragment.php' in the same directory as your .swf:
You need Flash Player to view the content here...
- The PHP script queries the irrepressible database and writes the data to an xml file in your directory (permissions etc must therefore be set as appropriate), the .swf file calls this script, then waits for the result. Once the data has been loaded, the .swf then processes the XML data and displays it in the textfield.