Classic Guestbook made with Flash and ASP/PHP

More Flash Code

Add two button instances for Next 10 and previous 10 records and add the following code in action window.

Code for next Button
on (release) {  // Increase limits by 10
   lowlimit = Number(lowlimit)+Number(10);
   highlimit = Number(highlimit)+Number(10);
   txtmain = "Processing Entries from "+lowlimit+" to "+highlimit+" Please wait ::: ";
loadVariablesNum ("guestbook.php?lowlimit="+lowlimit+"&highlimit="+highlimit, 0);
}


Code for Previous Button
on (release) {
   if (lowlimit == "0") {
   txtmain = "::::  Nothing before Zero ::::";
   }else{
         lowlimit = Number(lowlimit) - Number(10); // dec. limits by 10
   highlimit = Number(highlimit) - Number(10);
   txtmain = "Processing Entries "+lowlimit+" to "+highlimit+" Please wait for a while :::::: ";
   loadVariablesNum ("guestbook.php?lowlimit="+lowlimit+"&highlimit="+highlimit, 0);
   }
}


Add three dynamic text fields to the movie for Total entries(totalentries),Low Limit (txtll) and High Limit (txthl) respectively.  

Now Insert a new movie instance. Place four dynamic text boxes for name(textname) , email (txtemail) , website (txtwebsite) and comments (txtcomments). Add two buttons for Submit and Reset.

Code for Submit Button

on (release) {
   if (txtname eq "") {
       _root.txtmessage = "Name information missing.";
   } else if (txtemail eq "") {
       _root.txtmessage = "Email missing.";
   } else if (txtcomments eq "") {
       _root.txtmessage = "Comments missing.";
   } else if (txtwebsite eq "") {
       _root.txtmessage = "Enter the URL to your website";
   } else {
       submit= "Y";  // this variable will be used in PHP script to determine whether the new data has submitted or not.
       highlimit = 10;
       lowlimit = 0;
       _root.txtmain = "wait :::: Posting New Entry ::: ";
       loadVariablesNum ("guestbook.php", 0, "POST"); // send variable to PHP script
       _root.txtmessage = "Comments posted";
       txtname1=txtname;
       gotoAndStop (2);
   }
}


Code for reset button

on (release) {
   txtname = "";
   txtemail = "";
   txtWebsite = "http://";
   txtcomments = "";
}

You might also like...

Comments

About the author

Pradeep Mamgain India

Woking as a VB programmer. Use my free type in writing code and maintaining my site. I have an exclusive collection of PHP stuff for windows at my site.

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Walking on water and developing software from a specification are easy if both are frozen.” - Edward V Berard