Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash / PHP Shoutbox 1

Status
Not open for further replies.

exit12

Technical User
Aug 19, 2003
44
GB
Hi all

I'm trying to create a simple Flash shoutbox. It basically has three input boxes (with their variable names....."name,email and msg"). Once the user fills in these details, the variables will sent to a php script (via a submit button). My aim is to get the php script to output these variables to a dynamic text box within my movie. How do I these details from PHP to a specific dynamic box?

Thank You
 
basically using sendandload

are you saving the data to a text file or a mysql database ( different php file structure)
 
Hi thanks for the reply,

I was thinking about going along the mysql route....I'm going to be hosting this on my home server. Is there advantages/disadvantages between the text/mysql routes?

what would the basic as look like for my submit button?

Thanks
 
must be at least the third time i've replied to a similar question in the last week or two

id always go with mysql over textfiles as its so much easier to have a proper database stucture

for the submit button id point you to the downloads i posted earlier

pick apart and if you still have probs post back



files


then added a bit more functionality


files

 
Bill

Thanks a lot for the info.
I've managed to get my data into my database, and display it when i click my "refresh button", but I have a problem somewhere as it's not displaying as it should in my messages box. The font seems to be huge even though it's set at only size 10, also the name is the only variable that seems to be shown.
If you have time, I've included my files below

How do I control the way the info is output in my flash movie? is it through the php file itself? eg. if I wanted this format

Name:
Email:
---------------------------
Message:

or would I do it via action script?

Any help greatly appreciated! thanks
 
the zip does not contain the fla so cant tell what if anything is wrong there

i find it easiest to format the output in php

reason the font may be huge is that you may have resized the text boxes. try deleting the text boxes and replacing.
 
Sorry, my mistake. I added the swf inseatd of the .fla. This should have the .fla

I've tried resizing the box, still the same. I've been reading through some tutorials etc.., and it says that to output my variables in Flash, they have to be converted to one long string..didn't really undestand. This was what was confusing me about formatting my info for output, as if it was converted to one long string, how would I add the line breaks etc..

Thanks
 
you can push back as variables or as string

eg as string

$theString .= "<font color=\"#66ccff\"><b>$name</b></font><br>$message<br><a href=\"$news_uri\" target=\"_new\"><font color=\"#ffffcc\"><u>$email</a></u></font><br><br>";


usually add tags to make email clickable


still cant do much with your files however...id have to recreate the mysql db to properly test and right now dont have the time


if you still are having problems at the weekend i can look at in more depth then
 
Thanks Bill. I think I'll have it tonight sussed tonight! :)

This is the part in the loader.php script that is puzzling me, well some of it.

$r_string ='n='.mysql_num_rows ($qr);
$i=0
while ($row = mysql_fetch_assoc ($qr)) {
while (list ($key, $val) = each ($row)){
$r_string .='&' . $key .$i. '=' .$val ;

The first line has $r_string ='n='.mysql_num_rows ($qr);
I'm not understanding where this ='='n comes from and what it's for....

also in the flash movie,
for (i=0; i<this.n; i++) {
messages.text += this["name"+i]+" "+this["email"+i]+" "+this["msg"+i]+newline;
for the display/refresh function.

I feel this is the only parts that are confusing me. if I understood these then I'd be fine..

Thanks Again
 
just keeps a count of number of records its loading

allows to use myloadvars.n or this.n in the flash onload function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top