Finally, part 2 of this tutorial is here. Part 1 can be seen HERE. There you can find out how to prepare and format data for Flash and now we are about to do something with it. I’ve made a package of all required files for download so you can see what else will be used. Please download ZIP, unpack and open WP_flash.fla. Code is well commented and I am not about to explain how and why. This is just an example of my own implementation, you may develop your own and display data differently in Flash. My goal was to demonstrate WP – Flash data exchange on the simplest possible way.
Just for demo purpose upload all the files (and ’script’ folder as well!) to the root of your theme, it doesn’t matter which one. Now you need to call ‘WP_flash_holder.php’ in Browser but full path to this file must be used because we are currently out of WP ‘native environment’:
http://yourdomain.com/wp-content/themes/your_theme_name/WP_flash_holder.php.
For a case you are about to include WP_flash.swf in any existing template file of your theme (for example sidebar.php), things will work normally.
NOTE:
Open WP_flash_holder.php and change path to match your domain and theme name otherwise it’ll not work. For example the line reading:
<script src="http://your_domain.com/wp-content/themes/your_theme_name/script/swfobject.js" type="text/javascript"></script>
As well as:
var so = new SWFObject( "http://your_domain.com/wp-content/themes/your_theme_name/WP_flash.swf", "wpflash", "550", "400", "8" );
…must be replaced with your own data!
I guess some of you already plan to make a first Flash theme so it’s good to know that each and every WP theme must fulfill minimum requirements. Theme folder MUST contain the following files: index.php, style.css and functions.php (screenshot.png). In that case you can keep all of your Flash styles in style.css and embed Flash into index.php. Remember, it’s a long way to develop Flash theme and this tutorial is just a little tiny foot step on the long path up to the hill. Enjoy!
Yeap, 'slide_serve.php' by default MUST share location with Flash file (SWF) which checks its own path in file system on server - according to which PHP file is found.
However, if you take a look at FLA, line number 53 which reads:
extXML.load( myloc + "/slide_serve.php" );
...you can easily change location/path to 'slide_serve.php' manually.
Hopefully it helps!