Translator

Archive for March 2010

Flash MMO Server

These was some of my research on how to create Flash MMO Server:

MMO Server

http://www.smartfoxserver.com/products/basic.php

MMO Server with Flash Component/Editor

http://www.openspace-engine.com

MMO Flash API

http://www.nonoba.com/developers/multiplayerapi/overview

http://playerio.com/pricing/

Chat room kind of flash

http://palabre.gavroche.net/content/view/19/38/

Optimizing MySQL

Today i have encounter a problem where mysql used by our clients got hang.

And after 2 days of searching, i finally know that using too many left join (joining mysql table) while NOT INDEXING it would make database queries too long that can cause database hang.

The solution this situation is by using mysql index.

To retrieve rows from other tables when performing joins. MySQL can use indexes on columns more efficiently if they are declared as the same type and size. In this context, VARCHAR and CHAR are considered the same if they are declared as the same size. For example, VARCHAR(10) and CHAR(10) are the same size, but VARCHAR(10)and CHAR(15) are not.

Comparison of dissimilar columns may prevent use of indexes if values cannot be compared directly without conversion. Suppose that a numeric column is compared to a string column. For a given value such as 1 in the numeric column, it might compare equal to any number of values in the string column such as '1'' 1','00001', or '01.e1'. This rules out use of any indexes for the string column.

from http://dev.mysql.com/doc/refman/5.1/en/mysql-indexes.html

You can read more about this and how to create indexes as below:

http://dev.mysql.com/doc/refman/5.1/en/mysql-indexes.html

http://dev.mysql.com/doc/refman/5.0/en/create-index.html

Problem Solving: JQuery Pagination not working for next page

Problem Statement

I have used the jquery pagination that i have posted before. It was great tool but i have encounter some problem when deploying it to one of our client

Causes & How to solve it

1. You must ensure that you have followed the table structure by using <thead></thead> and <tbody><\tbody>

2. Remove Limit option in pager.

Jquery Problem cause at LIMIT

Jquery Pagination Solving

Jquery Pagination Solving: Remove LIMIT

Set Default Value for Pager JQuery plugin and Page Peel Plugin

Previously i have posted links for table pager using tablesorter pager plugin, however when i used it i found that i need to change the default value for different clients when first load.

This is how to do it:

Find these code

this.defaults = {
size: 10,
offset: 0,
page: 0,

and replace size with your choice. Example for me is size=4.

Thats all!

And while searching a solving for jquery pager plugin, i found out few interesting jquery plugins such as:

Page Peel

http://www.smple.com/pagePeel/

A simple but yet very easy page peel plugin. Just like the popular peel used by internet marketers…

Custom Cursor for AS3

http://www.actionscript.org/forums/showthread.php3?t=154644

As conclusion

var cursor:MovieClip;

function initializeMovie ():void
{
    cursor = new Cursor();
    addChild (cursor);
    cursor.enabled = false;
    Mouse.hide ();
    stage.addEventListener (MouseEvent.MOUSE_MOVE, dragCursor);
}

function dragCursor (event:MouseEvent):void
{
    cursor.x = this.mouseX;
    cursor.y = this.mouseY;
}

initializeMovie ();

Casting String to Number and Vise Versa

Hi,

Today i encounter a problem in AS3 where i want to cast a string to become a number and otherwise. So i googled and found 1 related article: http://www.wuup.co.uk/as3-quick-tips-string-to-number-conversion-and-vice-versa/

As summary:

// string to number
var myString:String = "5";
var myNumber:Number = Number(myString);
// number to string
var myNumber:Number= 5;
var myString:String= String(myNumber);
// string to int (integer)
var myString:String = "5";
var myInt:int = int(myString);