Jump to content


Flash Shoutbox


  • You cannot reply to this topic
3 replies to this topic

#1 Edmachine

    Young Padawan

  • Members
  • Pip
  • 44 posts
  • Gender:Male
  • Location:Latvia

Posted 06 August 2007 - 12:08 PM

Hello!

I am using a shoutbox made from a tutorial here

All is working well (the shoutbox posts, resets...), but it doesn't display the shouts.

It shows this:

_level0.shouts
undefined
undefined

undefined
undefined

And a few more lines like that.

You can find the ActionScript on that link on the 6th page.

The shout.php source:

<?php
 header("Content-type: text/xml");
 
 $host = "localhost";
 $user = "root";
 $pass = "";
 $database = "techgeeks";
 
 $linkID = mysql_connect($host,$user,$pass) or die ("Could not connect to host.");
 mysql_select_db($database,$linkID) or die ("Could not find database.");
 
 $query = "SELECT * from shoutbox ORDER BY id DESC";
 $resultID = mysql_query($query,$linkID) or die ("Data not found");
 
 $xml_output = "<?xml version =\"1.0\"?>\n";
 $xml_output = "<shouts>\n";
 
 for ($x = 0; $x < mysql_num_rows($resultID); $x++){
	 $row = mysql_fetch_assoc($resultID);
	 $xml_output .= "\t<shout>\n";
	 $xml_output .= "\t\t<name>" . $row['name'] . "</name>\n";
	 $xml_output .= "\t\t<message>" . $row['message'] . "</message>\n";
	 $xml_output .= "\t</shout>\n";
 }
 $xml_output.= "</shouts>";
 
 echo $xml_output;
 ?>

The post.php source

<?
 mysql_connect("localhost","root","");
 mysql_select_db("techgeeks");
 $submit = $_POST['submit'];
 $name = $_POST['name'];
 $message = $_POST['message'];
 if(isset($_POST['submit'])){
 $result=MYSQL_QUERY("INSERT INTO shoutbox (id,name,message)"."VALUES ('NULL','$name','$message'");
 echo '<script>alert("Shout posted");</script>';
 } else {
 }
 ?>
 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="500" height="100">
   <param name="movie" value="shoutbox.swf">
   <param name=quality value=high>
   <embed src="shoutbox.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="500" height="100"></embed>
 </object>


I am confused. I can't think of any reason for the error... please help!
ActionScript is in the link below
http://www.pixel2life.com/publish/tutorial..._and_xml/page6/

Edited by Edmachine, 06 August 2007 - 01:14 PM.


#2 Edmachine

    Young Padawan

  • Members
  • Pip
  • 44 posts
  • Gender:Male
  • Location:Latvia

Posted 09 August 2007 - 02:18 AM

Bump, please help! :)

#3 Ben

    P2L Jedi Master

  • Publishing Betazoids
  • PipPipPipPip
  • 1,366 posts
  • Gender:Male
  • Location:VIC, Australia

Posted 09 August 2007 - 05:51 PM

You sure it's connecting to your database

(Or you could just take my Flash shoutbox tutorial http://www.pixel2life.com/publish/tutorial...d_php_shoutbox/ :))

Edited by Ben, 09 August 2007 - 05:52 PM.


#4 Edmachine

    Young Padawan

  • Members
  • Pip
  • 44 posts
  • Gender:Male
  • Location:Latvia

Posted 10 August 2007 - 12:15 AM

I am sure about that.

And thanks, I'll try that some time, but not this weekend. Not at home. And just as I got my design perfectly what I want :biggrin:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users