![]() |
Quick Start GuideWARNING: Currently, FlashMOG Server only works on Linux machines which have PHP installed with socket functionality enabled. Also, you must have command line (CLI) access to your server in order to launch FlashMOG Server. Because many hosting companies do not offer CLI access and do not enable socket functionality within PHP, these instructions may not work for you. Step 1: Get FlashMOGDownload the Flashmog ZIP or TGZ file archive and decompress the file to some folder on your computer. Once the file is decompressed, it will create a folder named FlashMOG_x.x.x where 'x.x.x.' represents the current FlashMOG version number. Inside that folder will be two subfolders: client and server. An observant developer will recognize that some of these files belong on the server and some belong on your desktop machine where you create your Flash files. Step 2: Upload and Configure FlashMOG ServerTake the folder called 'server' and put it on your Linux web server (sorry windows not supported yet). It doesn't have to be in your public_html directory at all and probably should not be lest some sneaky person visit your webserver using a web browser and try to launch files by accessing them in a web browser. Let's assume for now that you put it in /var/www/server. Edit /var/www/server/fm_includes/config.php. You'll need to change these constants:
WARNING: The possible values you can choose for FM_HOST and FM_PORT will be dictated by your server setup. If you are having trouble, talk to your sysadmin or visit the FlashMOG Community Forum for support. You should remember your FM_HOST and FM_PORT settings because you must also enter them in FlashMOG Client. If you're a PHP whiz you can read the FlashMOG Source Code Documentation and take a stab at editing the other constants too. Step 3: Start FlashMOG ServerAs of this writing, you must login to your server via CLI to start FlashMOG Server. I use puTTY to login via SSH. If you don't know how to do this, these next instructions might be confusing. Talk to your sysadmin. Once you are logged in, invoke PHP to run the script /var/www/server/flashmog_server.php. On my machine this is as simple as typing commands (just the stuff after the '$') like this: user@server:~/foo/bar$ cd /var/www/server user@server:~/var/www/server$ ./flashmog_server.php
If FlashMOG Server starts correctly, you should see something like this: user@server:~/var/www/server$ ./flashmog_server.php Instantiating service classes... If you see that, then FlashMOG server should be running and listening for socket connections on whatever domain and port you specified in step 2 above. If you encounter any errors in this step, please refer to Server Installation for additional information on handling error conditions. Step 4: Connect with FlashMOG ClientAmong the files you downloaded in Step 1 should be a folder called client (right next to the one called server). Inside this folder is a file called FlashMOG_Test_x.x.x.fla. Open this file in Flash version 9 or later. On the first frame of the main timeline in the layer called 'actions' you will need to change two lines of code. Change 'somedomain.com' and '1234' on these two lines to match the domain and host you entered in Step 2 above:
myService = new Service(somedomain.com', 1234, 'myService');
myService2 = new Service('somedomain.com', 1234, 'myService2');
Now in Flash from the 'Control' menu run 'Test Movie' (or hit ctrl-enter). If everything works correctly, you should see a trace window indicating that you have connected: onConnect1 running! myService has connected. If you see connect success, then the flash movie you are running has successfully connected to FlashMOG server. You can click the buttons in the Flash movie to run methods on the server and disconnect, etc. If instead you get 'myService connection FAILED' then there is a problem somewhere. In that case, please visit the FlashMOG Community Forum for help. Step 5: Write Your Own CodeIf you have reached this point, then FlashMOG could be a useful development tool for you. To create your own game or application, you will need to expand or replace the classes on your server in /var/www/server/services with your own code. An experienced coder might gather from the existing sample code how things work in FlashMOG. The basic idea is that if you create a new class 'KibblesAndBits' in the file /var/www/server/services/KibblesAndBits.php then you can call the methods of this class from within your flash client by creating a Service using this actionscript: var kibbleAndBitService = new Service('yourdomain.com', 1234, 'KibblesAndBits');
If this is confusing or you need more information, check out some of the documentation resources or visit the FlashMOG Community Forum. |
|||||
![]() |
||||||