Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Simple GuestBook

This is a discussion on Simple GuestBook within the FlepStudio utilities forums, part of the Tutorials category; Here is an 'other free utilities for Flash CS3 created by FlepStudio. Since the previous Guest Book , despite having a ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Tutorials > FlepStudio utilities

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 14-05-08, 07:09
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,354
Blog Entries: 1
Rep Power: 6
Flep is on a distinguished road
Simple GuestBook

Here is an 'other free utilities for Flash CS3 created by FlepStudio.


Since the previous Guest Book, despite having a big success was a little cumbersome, I well thought of creating a new simple Guest Book Flash CS3 + and PHP mySQL.

This time was created with dimensions far more appropriate and is also prepared to be loaded into another SWF without having to change the code.

If you want to load it into your SWF root of your site or application or the site of your clients, just create the logics on your main FLA to load it and the game is made.


Easy to install, will certainly be a greatly appreciated resource for those of you need a classic Guest Book without many "frills":)


Installation



  1. Open the file configuration.php and change the setting for access to your database.

  2. Upload the PHP folder on your server in a folder in which you wish to install the Guest Book

  3. Go with the brower to address where is located PHP/install.php that you just uploaded

  4. Delete the file PHP/install.php from the server

  5. Open the file main.fla

  6. Open the file LoadingXML.as at line 22 and enter the absolute url of file PHP/getMessages.php you just uploaded

  7. Open the file SendMessage.as and rows 17 and 18 enter the absolute urls of files PHP/gettime.php and PHP/storeMessage.php you just uploaded

  8. Re-create the SWF by main.fla and GuestBook is already working

  9. Upload the new main.swf to server



Result









Description

GuestBook - Flash CS3 - PHP - mySQL


File packages

main.fla

package org.FlepStudio

package caurina ( Tweener by Zeh Fernando )

package PHP ( with all PHP files )

Attached Files
File Type: zip SimpleGuestbook_ENG.zip (722.9 KB, 786 views)

__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !

Last edited by Flep; 06-10-08 at 12:52.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 14-05-08, 11:12
Junior Member
 
Join Date: Mar 2008
Posts: 3
Rep Power: 0
flashkiddy is on a distinguished road
Re: Simple GuestBook

is it me or is the send button not working in the preview version?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 14-05-08, 12:25
Junior Member
 
Join Date: May 2008
Posts: 1
Rep Power: 0
thinkmedia is on a distinguished road
Re: Simple GuestBook

nah, its not working with me either

looks alright tho
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 14-05-08, 12:30
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,354
Blog Entries: 1
Rep Power: 6
Flep is on a distinguished road
Re: Simple GuestBook

Sorry guys, I am fixing the bug.
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 14-05-08, 12:48
Junior Member
 
Join Date: Apr 2008
Posts: 3
Rep Power: 0
ugur01 is on a distinguished road
Re: Simple GuestBook

Yeah send button wont work
But its look cool
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

photoFlow

  #6 (permalink)  
Old 14-05-08, 13:20
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,354
Blog Entries: 1
Rep Power: 6
Flep is on a distinguished road
Re: Simple GuestBook

Ok,
problem was with "<" and ">" characters.
I added a control and they are not allowed.

Re- download the files or do the following:

change Main.as with the following:
Code:
/*
 *************************************
  Flash CS3 Simple Guestbook                            
  http://www.flepstudio.org     
  © Author: Filippo Lughi          
  version 1.0                                
 *************************************
 */
package org.FlepStudio
{
	import flash.display.*;
	import flash.events.*;
	import flash.text.*;
	import flash.utils.*;
	import flash.ui.*;
	import flash.net.*;
	import caurina.transitions.Tweener;
	
	public class Main extends MovieClip
	{
		private var file_xml:LoadingXML;
		
		public var messages_array:Array;
		
		private var timer:Timer;
		
		private var trick_mc:MovieClip;
		private var apple_mc:Apple;
		private var boo:Boolean=true;
		
		public function Main()
		{
			addEventListener(Event.ADDED_TO_STAGE,init);
		}
		
		private function init(evt:Event):void
		{
			removeEventListener(Event.ADDED_TO_STAGE,init);
			
			initMenu();
			
			stage.frameRate=31;
			
			area_txt.editable=false;
			
			form_mc.name_txt.border=true;
			form_mc.name_txt.borderColor=0x999999;
			form_mc.name_txt.background=true;
			form_mc.name_txt.backgroundColor=0x999999;
			form_mc.name_txt.textColor=0xFFFFFF;
			
			form_mc.mess_txt.border=true;
			form_mc.mess_txt.borderColor=0x999999;
			form_mc.mess_txt.background=true;
			form_mc.mess_txt.backgroundColor=0x999999;
			form_mc.mess_txt.textColor=0xFFFFFF;
			
			loadXML();
		}
		
		private function loadXML():void
		{
			file_xml=new LoadingXML(this);
		}
		
		public function displayMessages():void
		{
			messages_array.reverse();
			displayText();
			addButtonListener();
		}
		
		private function displayText():void
		{
			var final:String="";
			
			for(var i:int=0;i"+messages_array[i].date+""+
				""+"\n"+""+''+messages_array[i].name+""+
				""+''+" says :"+""+"\n"+
				''+messages_array[i].mess+""+"\n\n";
			}
			
			area_txt.htmlText=final;
		}
		
		private function addButtonListener():void
		{
			form_mc.send_mc.mouseChildren=false;
			form_mc.send_mc.buttonMode=true;
			form_mc.send_mc.addEventListener(MouseEvent.MOUSE_DOWN,checkFields);
		}
		
		private function checkFields(evt:MouseEvent):void
		{
			if(form_mc.name_txt.text!="")
			{
				if(form_mc.mess_txt.text!="")
				{
					sendMessage();
				}
				else
				{
					noMessage();
					removeError();
				}
			}
			else
			{
				noName();
				removeError();
			}
		}
		
		private function removeError():void
		{
			timer=new Timer(2000,1);
			timer.addEventListener(TimerEvent.TIMER,resetErrorField);
			timer.start();
		}
		
		private function resetErrorField(evt:TimerEvent):void
		{
			form_mc.error_txt.text="";
			boo=true;
		}
		
		private function noString():void
		{
			form_mc.error_txt.text=">< NOT SUPPORTED";
		}
		
		private function noName():void
		{
			form_mc.error_txt.text="UNDEFINED NAME";
		}
		
		private function noMessage():void
		{
			form_mc.error_txt.text="UNDEFINED MESSAGE";
		}
		
		private function sendMessage():void
		{
			var s:String=form_mc.mess_txt.text;
			for(var j:int=0;j")
				{
					boo=false;
					noString();
					removeError();
					break;
				}
			}
			if(boo)
			{
				onSending();
				var message_sender:SendMessage=new SendMessage(this);
			}
		}
		
		private function onSending():void
		{
			trick_mc=new MovieClip();
			trick_mc.alpha=0;
			trick_mc.graphics.beginFill(0xFFFFFF,1);
			trick_mc.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
			addChild(trick_mc);
			
			Tweener.addTween(trick_mc,{alpha:0.8,time:0.4,transition:"linear"});
			
			apple_mc=new Apple();
			apple_mc.width=40;
			apple_mc.height=40;
			apple_mc.alpha=0.7;
			apple_mc.x=stage.stageWidth/2-apple_mc.width/2;
			apple_mc.y=stage.stageHeight/2-apple_mc.height/2;
			addChild(apple_mc);
		}
		
		public function successSending():void
		{
			apple_mc.stop();
			removeChild(apple_mc);
			
			Tweener.addTween(trick_mc,{alpha:0,time:0.4,transition:"linear",onComplete:removeTrick});
		}
		
		private function removeTrick():void
		{
			refresh();
			removeChild(trick_mc);
		}
		
		public function refresh():void
		{
			messages_array=new Array();
			area_txt.text="";
			form_mc.name_txt.text="";
			form_mc.mess_txt.text="";
			loadXML();
		}
		
		public function initMenu():void
		{
			var etichetta:String='Flash CS3 GuestBook';
			var cm:ContextMenu=new ContextMenu();
			var item:ContextMenuItem=new ContextMenuItem(etichetta);
			cm.hideBuiltInItems();
			cm.customItems.push(item);
			item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,itemHandler1);
			this.contextMenu=cm;
		}
		private function itemHandler1(event:ContextMenuEvent):void
		{
			var url:String='http://www.flepstudio.org/';
			var request:URLRequest=new URLRequest(url);
			navigateToURL(request,'_parent');
		}
	}
}
Re-create the SWF.

Change getMessages.php with the following:
PHP Code:
<?php
    
/*
 *************************************
  Flash CS3 Simple Guestbook                            
  http://www.flepstudio.org     
  Author: Filippo Lughi          
  version 1.0                                
 *************************************
 */
    
include('configuration.php');
    
    
$mysql mysql_connect($dbhost,$dbuser,$dbpass);
    
mysql_select_db($dbname);
    
    
$Query="SELECT * from simple_guestbook";
    
$Result=mysql_query$Query );
    
$Return="<?xml version=".'"1.0"'." encoding=".'"UTF-8"?>'."\n"."<items>";
    
    while(
$item=mysql_fetch_object($Result))
    {
     
$Return.="<item><id>".$item->ID."</id><name>".$item->name."</name><message>"."<![CDATA[".$item->message."]]>"."</message><date>".$item->date."</date></item>"
    }
    
$Return.="</items>";
    
mysql_free_result($Result);
    echo (
$Return)
?>
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !

Last edited by Flep; 15-05-08 at 06:08.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 15-05-08, 05:50
Junior Member
 
Join Date: Feb 2008
Posts: 5
Rep Power: 0
bhatushai is on a distinguished road
Re: Simple GuestBook

you also forgot to add < > here "![CDATA[".$item->message."]]"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 15-05-08, 06:08
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,354
Blog Entries: 1
Rep Power: 6
Flep is on a distinguished road
Re: Simple GuestBook

Quote:
Originally Posted by bhatushai View Post
you also forgot to add < > here "![CDATA[".$item->message."]]"
yes sorry

I fixed it.

thx
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 25-05-08, 20:10
Junior Member
 
Join Date: May 2008
Posts: 1
Rep Power: 0
andersom is on a distinguished road
Re: Simple GuestBook

i get an ![CDATA[ in front of my message???? how to fix?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 25-05-08, 20:36
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,354
Blog Entries: 1
Rep Power: 6
Flep is on a distinguished road
Re: Simple GuestBook

Replace getMessages.php with this:
PHP Code:
<?php
    
/*
 *************************************
  Flash CS3 Simple Guestbook                            
  http://www.flepstudio.org     
  Author: Filippo Lughi          
  version 1.0                                
 *************************************
 */
    
include('configuration.php');
    
    
$mysql mysql_connect($dbhost,$dbuser,$dbpass);
    
mysql_select_db($dbname);
    
    
$Query="SELECT * from simple_guestbook";
    
$Result=mysql_query$Query );
    
$Return="<?xml version=".'"1.0"'." encoding=".'"UTF-8"?>'."\n"."<items>";
    
    while(
$item=mysql_fetch_object($Result))
    {
     
$Return.="<item><id>".$item->ID."</id><name>".$item->name."</name><message>"."<![CDATA[".$item->message."]]>"."</message><date>".$item->date."</date></item>"
    }
    
$Return.="</items>";
    
mysql_free_result($Result);
    echo (
$Return)
?>
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Simple Guestbook Flep Utilità di FlepStudio 26 29-05-08 05:38
Simple Problem Driving me Crazy nxtgenpro advanced Actionscript 3.0 1 28-05-08 20:23
Simple:Loading external SWF mabron Actionscript 3.0 newbies 1 14-05-08 22:02
Simple Email Form Problem chosendesigns PHP | mySQL | Flash CS3 1 26-04-08 10:28
simple swf preloader compile error jimbo HELP free utilities 3 27-07-07 13:49


All times are GMT. The time now is 19:48.


Powered by vBulletin versione 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406