FYP 2 - Programming Progress 1

*I accidentally replaced this post with Programming Progress 2, so need to rewrite again :(

------
I decided to convert the layout designed previously to HTML first to see how it looks and feel, and may help to improve the design.

At first I plan to do in XHTML & CSS which is the trend lately, but I found that my layout are very simple, using table should be enough for it.

So I started to do slicing in Photoshop, just simply slide out the images because the layout details will adjust in HTML.


Then I started to working on the HTML in Crimson Editor, a good free source editor.


- added < body style="margin:0;"> to make everything align in the center of the browser, no matter in what resolution.

- set the font family as Verdana,san-serif and font size as 16px which is quite big if compared to other common website, but I think bigger font size is easier for users to read.


*Feel like quite hard to do the bottom part which is grab random photos from the gallery and arrange it like the planned design, due to the irregular placement. But will try to find and think of some way to solve this problem, if cannot make it maybe just arrange it nicely or do it manually in Photoshop.


For the photo details page, I decided to use Facebook social plugin such as the Like Button, Share Button and Comment system, to make the users more convenience because no need to register an account just for vote or comment.


To integrate the Facebook social plugin in website, it required us to create a Facebook App first to get the appId


Then just using the script provided in http://developers.facebook.com/docs/plugins/


For the Share Button, I choose to use plugin from http://www.addthis.com/ to support for more services like tweeter and email.

FYP 2 - Idea Development

I had search the internet and found some example for what I plan to do, which is the add graphics in the photo after taken it.



But it doesn't really looks funny right? and I think if it is really funny, that is not the feeling that i want for. I will prefer a simple and warm feeling instead of this kind of funny. So again I decided to back to simple, cancel the add graphic function. But, there are some replacement for it, which is add in some texts to it.

Something like this:


I think text can help to convey the message or feeling more clearly in supporting the photos. After some consideration, I decided to do this in a way that users can click a button and it will generate random quote in the photos. Because some users may not have the idea for the texts and I want to make the process as simple as possible, which can done easily.

FYP 2 - Programming Research

Research about the integration between flash and mysql database, and found out the progress are as below:


When need to take data from mysql, we need to use php to get the data and put in a xml file, and then only flash can get the data.

When saving data from flash to mysql, it can directly send to php and insert into mysql table.


Below is the sample script for php to get data from mysql and generate a xml file to save the data:
require "connectdb.php";

$query='SELECT * FROM myguestbook order by id desc';
$result=mysql_query($query);

echo "\n";
echo "\n";
while($line=mysql_fetch_assoc($result))
{
echo "\n";
echo "".$line["name"]."\n";
echo "".$line["comment"]."\n";
echo "\n";
echo "
\n";
}
echo "
\n";

mysql_close();


Below is the sample script for php to fetch the data from flash and insert into mysql table:
require "connectdb.php";

$name=$_POST['uname'];
$comment=$_POST['ucomment'];
$Today = date("Ymd,l,H:i");
$id=date("YmdHis");

$str_sql="INSERT INTO myguestbook (name,comment,time,id) VALUES ('$name','$comment','$Today','$id');";
if(mysql_query($str_sql))
{
$info= "Save data success!";
}
else
{
$info= "Save data failure!";
}
mysql_close();

echo "&backinfo=".$info."&";


Below is the sample script for flash to save and load the data from mysql.
stop();
var canSend_boo:Boolean=false;

function checkText()
{
if(trim(_nameTi.text)=="")
{
mx.controls.Alert.show("Name is empty£¡");
}else if(trim(_commentTa.text)=="")
{
mx.controls.Alert.show("Message is empty£¡");
}else
{
canSend=true;
}
}

function trim(s:String):String
{
var new_str:String;
new_str=s.split(" ").join("");
new_str=new_str.split("¡¡").join("");
return new_str;
}

state_var="";

var myXML:XML=new XML();
myXML.ignoreWhite=true;

myXML.onLoad=function (success)
{
if (success)
{
loadData();
state_var+="Load XML success.\n";
}
else
{
_outTa.text="Load Data Failed¡£";
}
}
myXML.load("datatoxml.php?n="+random(9999));

function loadData()
{
_outTa.text="";
var nodes=myXML.firstChild.childNodes;
_numLbl.text="Message"+nodes.length+;
for(i=0;i<"nodes.length";i++) ()="" (cansend)senddata();="" (success)="" );="" +="Failed to Load\n" ;="" _commentta.text="" _outta.text="_outTa.text+"Name£ยบ"+nodes[i].childNodes[0].childNodes+"\n";" _savebtn.onrelease="function" checktext();="" data_lv.onload="function(success)" data_lv.sendandload(="" data_lv.ucomment="trim(_commentTa.text);" data_lv.uname="trim(_nameTi.text);" data_lv:loadvars="new" datatosql.php?n="+random(9999), data_lv, " datatoxml.php?n="+random(9999)); _nameTi.text=" else="" function="" if="" loaddata();="" loadvars();="" myxml.load(="" post="" senddata()="" state_var+="Send data......\n" state_var="" var="" {="" };="" }="">

FYP 2 - Layout Design

After the failed on the previous idea, I started to think from beginning, what is the feel that my project give to people, what design style should I use for the layout etc. I also asked friends opinions to understand from other perspective.

Then I recall back the most simple concept I had when the starting of this project which is just to share happiness. Finally I decided to use minimal swiss design style to make the layout as simple as possible but carry out happiness feeling to users. After that I keep on research and finding references in this direction, and found out using warm color is a good way to bring out cheerful and energetic feeling in a design. Then i decided to use yellow color as the main color for the layout and directly experimentally to design the layout in photoshop because I feel that sketching are hard to testing with color and feeling.

So this is the outcome:



Minimal header design, short introduction and a introduction video. The photos below are planned for random photos from the gallery that will change every time refresh the browser (for now I just used images downloaded from internet to see the effect)

The design are compatible with different screen resolution such as wide screen 1280x800 or standard screen 1024x768, as both of the resolution having great amount of users.

This layout will be use for other pages also, with adjustment depends on the page content.


FYP 2 - Failed Layout Sketches

Below are some of the sketches for layout design. But after consideration, I feel that it is not good enough and cannot bring out the feeling that I want. But I still post it here as the record of the progress.

The main concept is to create a realistic environment and combine with interaction. As the main objects in this project is smiling photos, so i decided to create a top view layout, and simulated that everything are put on table, such as the example below:


Okay here are the sketches:

Home page planned for short intro in text and video. Some random photos saved in the gallery will be show beside, users can move the photos around by mouse to see the photos below.

About page is the introduction written on papers.

Gallery page is putting all the saved photos in a photo album, users can flip it like a real book.

The Join page planned to make the photo taking function has a visual of a real camera.




FYP 2 - Research on transform function

Research on the part of "adding graphics to the photos after taking it", and found transform function for it. The transform function can move, scale and rotate movie clip.

Demo: (click on the blue box to activate the transform option)


The script grab from: http://proto.layer51.com/d.aspx?f=636

FYP 2 - Page Structure Planning

In FYP 1, I had been thinking the site need to be done by:

Flash - for the webcam capture image & add effects functions
mysql - to create a database that can save users captured images
php - to integrate with database and create functions such as users comment system

But I am not sure about, is to create a full flash site and include php/html function in it, or to create a php site and embed the flash on the page that need the functions.

After some research, I found that Flash has very limited support to html code, so I can only use the second way which is embed the flash in php pages.

But I feel like if the whole site is using php and only embed the flash in the "Join" page which has webcam funtion, it will be lack of the advantages of flash layout, such as button roll over effect and other motion things. So I plan to divide the page into few parts, some parts embed flash such as top navigation menu and some parts using php such as users comment.

The following picture show the division of site into flash and html: