Flash Gallery | Flash Templates | Flash Menu | Flash Design | Flash Audio & Video

flash page flip

Actionscript 3.0 video tutorials

+ Reply to Thread
Page 1 of 12 1 2 3 11 ... LastLast
Results 1 to 10 of 118

Thread: Simple GuestBook

  1. #1
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    Simple GuestBook

    flash templates

    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

  2. #2
    Junior Member Settled In flashkiddy is on a distinguished road
    Join Date
    Mar 2008
    Posts
    3
    Rep Power
    0

    Re: Simple GuestBook

    is it me or is the send button not working in the preview version?

  3. #3
    Junior Member Settled In thinkmedia is on a distinguished road
    Join Date
    May 2008
    Posts
    1
    Rep Power
    0

    Re: Simple GuestBook

    nah, its not working with me either

    looks alright tho

  4. #4
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    Re: Simple GuestBook

    Sorry guys, I am fixing the bug.

  5. #5
    Junior Member Settled In ugur01 is on a distinguished road
    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    0

    Re: Simple GuestBook

    Yeah send button wont work
    But its look cool

  6. #6
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    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)
    ?>

  7. #7
    Junior Member Settled In bhatushai is on a distinguished road
    Join Date
    Feb 2008
    Posts
    7
    Rep Power
    0

    Re: Simple GuestBook

    you also forgot to add < > here "![CDATA[".$item->message."]]"

  8. #8
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    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

  9. #9
    Junior Member Settled In andersom is on a distinguished road
    Join Date
    May 2008
    Posts
    1
    Rep Power
    0

    Re: Simple GuestBook

    i get an ![CDATA[ in front of my message???? how to fix?

  10. #10
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    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)
    ?>

+ Reply to Thread
Page 1 of 12 1 2 3 11 ... LastLast

LinkBacks (?)


Similar Threads

  1. Simple Guestbook
    By Flep in forum Utilità di FlepStudio
    Replies: 54
    Last Post: 16-02-10, 10:56
  2. Stuck with a simple script
    By biggsy in forum Flash English
    Replies: 2
    Last Post: 28-04-09, 05:17
  3. I'm new ask a simple question
    By davids701124 in forum Actionscript 3.0 newbies
    Replies: 2
    Last Post: 14-03-09, 17:47
  4. simple gallery in AS3
    By karcinka in forum Actionscript 3.0 base
    Replies: 9
    Last Post: 24-11-08, 06:32
  5. Simple:Loading external SWF
    By mabron in forum Actionscript 3.0 newbies
    Replies: 1
    Last Post: 14-05-08, 22:02

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts