1. Start off by creating a new document in photoshop, 322x296
Create the layout of your shoutbox, make sure you leave a space for, Name and Message fields, also a window for the shouts to be displayed in.
Here is what I have created:
2. Then open up Flash MX and create a 322x296 document, then goto file>import>to stage
3. Then browse to the shoutbox layout you have created and center it in the middle of the stage
4. Then in the actions dialog, enter this action
5. Create a new layer and do the following
a. create a square box over the button that says shout, or whatever you have put and select it
b. press f8 to convert it to a symbol, select button and name it shout
c. select ok and double click the button you just made and right click the hit frame, select insert keyframe
d. then move back to the Up keyframe and select the box you made, and select it, then goto edit clear
e. move back to the stage and duplicate the button and move it over reset
f. select the shout button and apply this action
g. do the same with the reset button except have it goto the reset frame
All done with those two buttons, now lets move onto the text fields, do the following
6. Create a dynamic text field the size of where you want the shouts to be viewed
Then create two input text field over name and message areas
Here are the settigs for each field
Make sure they are both set to single line
Then create a new keyframe, name the frame, shout
Add this action to the frame
What this does is, it asks flash if name is empty or if message is empty, if they are, tell the user they need to enter there name & or message
Then create a new keyframe named post, make sure it is about 30 frames ahead
Then add this action
then, 10 frames later create a keyframe named, reset
Add the following actions
That wraps up the flash part, now we will move on to php
Create a new file in your favorite text editor and enter this.
| <?php
mysql_connect("host", "username", "password"); mysql_select_db("database_name"); ?> |
Save it as dbconnect.php. Then create another new file in the text editor and enter this.
| <?php
include("dbconnect.php"); $query = "SELECT * FROM shouts ORDER BY autoID DESC"; $shouts = mysql_query($query); $row_shouts = mysql_fetch_assoc($shouts); ?> message=<?php do { ?><b><?php echo $row_shouts['name']; ?></b><br><?php echo $row_shouts['message']; ?><br><?php } while ($row_shouts = mysql_fetch_assoc($shouts)); ?> |
Save it as shouts.php. Then create another new file and enter this.
| <?php
include("dbconnect.php"); $query = "INSERT INTO messages (name, message) VALUES ($name, $message)"; mysql_query($query); ?> |
Save it as post.php. Then goto your mysql console or php my admin and execute this.
| CREATE TABLE 'shouts' ( 'autoID' INT( 11 ) NOT NULL AUTO_INCREMENT ,
'name' VARCHAR( 85 ) , 'message' TEXT, PRIMARY KEY ( 'autoID' ) ); |
That will create the table and fields required for the shoutbox, That should be it, thanks people.












