Title: Pages in Flash
Last modified: August 18, 2016

---

# Pages in Flash

 *  Resolved [sophistikat](https://wordpress.org/support/users/sophistikat/)
 * (@sophistikat)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/pages-in-flash/)
 * Hello.
 * I am developing my own theme and I am stuck right now. I want to pass the page
   information to my flash movie.
 * I have: (menu.php)
 *     ```
       <?php
   
       	$link = mysql_connect("localhost", "root", "root");
       	mysql_select_db("whiteboardiaries");
   
       	$query = 'SELECT * FROM wp_posts WHERE post_type="page"';
       	$results = mysql_query($query);
   
       	echo "<?xml version=\"1.0\"?>\n";
       	echo "<menu>\n";
   
       	echo "\t<page>\n";
       	echo "\t\t<item>";
       	bloginfo("name") ;
       	echo "</item>\n";
       	echo "\t\t<url>";
       	bloginfo("url");
       	echo "</url>\n";
       	echo "\t</page>\n";
   
       	while ($page = mysql_fetch_assoc($results))
       	{
       		echo "\t<page>\n";
       		echo "\t\t<item>" . $page["post_title"] . "</item>\n";
       		echo "\t\t<url>" . $page["guid"] . "</url>\n";
       		echo "\t</page>\n";
       	}
   
       	echo "</menu>\n";
   
       	mysql_close($link);
       ?>
       ```
   
 * When I test my site, using `<?php include (TEMPLATEPATH . '/menu.php') ?>` it
   outputs `<?xml version=”1.0″?>
    <menu> <page> <item>Whiteboard Diaries</item>
 *  <url>[http://localhost:8888/empirical.com/whiteboarddiaries</url&gt](http://localhost:8888/empirical.com/whiteboarddiaries</url&gt);
   
   </page> <page> <item>About Me</item> <url>[http://localhost:8888/empirical.com/whiteboarddiaries/?page_id=4</url&gt](http://localhost:8888/empirical.com/whiteboarddiaries/?page_id=4</url&gt);
   </page> <page>
 *  <item>Portfolio</item>
    <url>[http://localhost:8888/empirical.com/whiteboarddiaries/?page_id=5</url&gt](http://localhost:8888/empirical.com/whiteboarddiaries/?page_id=5</url&gt);
   </page> <page> <item>Contact Me</item> <url>[http://localhost:8888/empirical.com/whiteboarddiaries/?page_id=6</url&gt](http://localhost:8888/empirical.com/whiteboarddiaries/?page_id=6</url&gt);
   </page>
 * </menu>` onto the page… which is correct!
 * BUT
 * When I embed my flash movie, I can’t seem to pass the xml output properly?!!
 * I have tried:
 *     ```
       <script type="text/javascript">
       		// <![CDATA[
       		var so = new SWFObject("http://localhost:8888/empirical.com/whiteboarddiaries/wp-content/themes/whiteboard/swf/pages.swf", "flashMenu", "100%", "45", "6", "#000000");
       		so.addVariable('xml_location', <?= include (TEMPLATEPATH . '/menu.php') ?>);
       		so.write("flashMenu");
       		// ]]>
       	</script>
       ```
   
 * and
 *     ```
       <script type="text/javascript">
       		// <![CDATA[
       		var so = new SWFObject("http://localhost:8888/empirical.com/whiteboarddiaries/wp-content/themes/whiteboard/swf/pages.swf", "flashMenu", "100%", "45", "6", "#000000");
       		so.addVariable('xml_location', 'http://localhost:8888/empirical.com/whiteboarddiaries/wp-content/themes/whiteboard/menu.php');
       		so.write("flashMenu");
       		// ]]>
       	</script>
       ```
   
 * NOW
 * pass the entire location seems right but the php is not being executed and it
   looks like flash is reading the content of the PHP script and not the output 
   of the PHP script.
 * Any thoughts?
    Did I lose you?

Viewing 1 replies (of 1 total)

 *  Thread Starter [sophistikat](https://wordpress.org/support/users/sophistikat/)
 * (@sophistikat)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/pages-in-flash/#post-590314)
 * I figured this out. The bloginfo() function’s output did not work with what i
   wanted so i simply queried the wp_options table to get the blog name and url.
 * `
    # add to tag: blog title $name_query = 'SELECT option_name, option_value FROM
   wp_options WHERE option_name="blogname"'; $name_results = mysql_query($name_query);
   while($name_row = mysql_fetch_assoc($name_results)) { echo "\t\t<item>" . $name_row['
   option_value'] . "</item>\n"; }
 *  # add to tag: blog url
    $url_query = 'SELECT option_name, option_value FROM 
   wp_options WHERE option_name="siteurl"'; $url_results = mysql_query($url_query);
   while($url_row = mysql_fetch_assoc($url_results)) { echo "\t\t<url>" . $url_row['
   option_value'] . "</item>\n"; }

Viewing 1 replies (of 1 total)

The topic ‘Pages in Flash’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [sophistikat](https://wordpress.org/support/users/sophistikat/)
 * Last activity: [18 years, 10 months ago](https://wordpress.org/support/topic/pages-in-flash/#post-590314)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
