Very good work !!!
Now it will be interresting to developp memory game with pair image etc ...
Thanks a lot
This is a discussion on Memory Game - Flash CS3 game within the FlepStudio utilities forums, part of the Flash English category; FlepStudio has created a new free utility. This is a game in Flash CS3. Many of you will recall that ...
FlepStudio has created a new free utility.
This is a game in Flash CS3.
Many of you will recall that it was a very popular game ( at least when I was a child ).
In my opinion is still very good as pastime and as coach of memory.
In practice we 4 colored buttons that perform a sequence (increasing one for each level) and simply reproduce the exact sequence
This game has been developed with Flash CS3, PHP and mySQL.
I decided to support it to a database in order to create the Top Ten of the top 10 players.
You can download the source files and install it easily.
INSTALLATION1) Open the files topTen.php and storeData.php and enter the information of your database (username, password and name DataBase).
2) Creating the table in the database using the file. Sql that I made available (memory_game.sql).
3) Load on your domain files topTen.php and storeData.php.
4) Open the files org/FlepStudio/TopTen.as and org/FlepStudio/StoreData.as and change the urls call to their files PHP.
5) Re-create the SWF.
6) Load on your domain main.swf
Source files:
Last edited by Flep; 30-08-08 at 11:55.
Very good work !!!
Now it will be interresting to developp memory game with pair image etc ...
Thanks a lot
great work. thanks
Fixed a little bug.
Change the file org/FlepStudio/TopTen.as
with the following:
Code:/* ************************************* * Memory Game * http://www.FlepStudio.org * © Author: Filippo Lughi * version 1.0 ************************************* */ package org.FlepStudio { import flash.display.*; import flash.events.*; import flash.net.*; import flash.xml.*; import caurina.transitions.Tweener; public class TopTen { private var request:URLRequest=new URLRequest('http://www.flepstudio.org/utilita/MemoryGame/topTen.php'); private var _fla:MovieClip; private var players_fields_array:Array; private var scores_fields_array:Array; private var players_array:Array=new Array(); private var names_array:Array=new Array(); private var surnames_array:Array=new Array(); public function TopTen(fla:MovieClip) { _fla=fla; players_fields_array=new Array(_fla.top_mc.player_0_txt,_fla.top_mc.player_1_txt,_fla.top_mc.player_2_txt,_fla.top_mc.player_3_txt,_fla.top_mc.player_4_txt, _fla.top_mc.player_5_txt,_fla.top_mc.player_6_txt,_fla.top_mc.player_7_txt,_fla.top_mc.player_8_txt,_fla.top_mc.player_9_txt); scores_fields_array=new Array(_fla.top_mc.score_0_txt,_fla.top_mc.score_1_txt,_fla.top_mc.score_2_txt,_fla.top_mc.score_3_txt,_fla.top_mc.score_4_txt, _fla.top_mc.score_5_txt,_fla.top_mc.score_6_txt,_fla.top_mc.score_7_txt,_fla.top_mc.score_8_txt,_fla.top_mc.score_9_txt); for(var i:int=0;i < players_fields_array.length;i++) { players_fields_array[i].alpha=0; scores_fields_array[i].alpha=0; } this.loadXML(); } private function loadXML():void { var loader:URLLoader=new URLLoader(); loader.addEventListener(Event.COMPLETE,completeHandler); try { loader.load(request); } catch(error:Error) { trace('Impossibile caricare il documento.'); } } private function completeHandler(event:Event):void { var result:XML=new XML(event.target.data); var myXML:XMLDocument=new XMLDocument(); myXML.ignoreWhite=true; myXML.parseXML(result.toXMLString()); var node:XMLNode=myXML.firstChild; var n:int=int(node.childNodes.length); for(var i:int=0;i10) break; } displayNames(); fadeInScores(); } private function getRightName(n:int):void { for(var i:int=0;i < players_array.length;i++) { if(players_array[i].score==n) { if(names_array.length<10) { names_array.push(players_array[i].name); surnames_array.push(players_array[i].surname); players_array.splice(i,1); } else break; } } trace(names_array); } private function displayNames():void { for(var j:int=0;j < names_array.length;j++) { players_fields_array[j].text=names_array[j]+" "+surnames_array[j]; } } private function fadeInScores():void { for(var i:int=0;i < players_fields_array.length;i++) { Tweener.addTween(players_fields_array[i],{alpha:1,time:0.2,delay:i*0.1,transition:"easeOutQuad"}); Tweener.addTween(scores_fields_array[i],{alpha:1,time:0.2,delay:i*0.1,transition:"easeOutQuad"}); } } } }
Thank you, Filippo. It will be used in the children's section of a church site I develop.
Dan
Very nice, thanks.
However, I have trouble to install it on my database:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf33 0
{\fonttbl\f0\fmodern\fcharset' at line 1
Any idea how to solve that?
Thanks in advance.
That was fun. I just played it the first time and my score was 9090, but i don't see it in the list just yet.
Bookmarks